Revision 41d514e3
Added by Patrick Plitzner almost 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizard.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.cdm.api.service.IUserService; |
21 | 21 |
import eu.etaxonomy.cdm.model.common.User; |
22 | 22 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
23 |
import eu.etaxonomy.taxeditor.Messages; |
|
23 | 24 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
24 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
25 | 26 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
... | ... | |
43 | 44 |
public PasswordWizard(User user, ConversationHolder conversation){ |
44 | 45 |
this.conversation = conversation; |
45 | 46 |
this.user = user; |
46 |
setWindowTitle("Change password");
|
|
47 |
setWindowTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
|
|
47 | 48 |
} |
48 | 49 |
|
49 | 50 |
@Override |
... | ... | |
60 | 61 |
ConversationHolder internalConversation = CdmStore.getCurrentApplicationConfiguration().NewConversation(); |
61 | 62 |
internalConversation.bind(); |
62 | 63 |
internalConversation.startTransaction(); |
63 |
try{ |
|
64 |
String warningTitle = Messages.PasswordWizard_COULD_NOT_CHANGE_PWD; |
|
65 |
String warningMessage = Messages.PasswordWizard_OLD_PWD_INCORRECT; |
|
66 |
try{ |
|
64 | 67 |
if(passwordPage.isChangingOwnPassword()){ |
65 | 68 |
// change own password with validating of old one |
66 | 69 |
CdmStore.getService(IUserService.class).changePassword(passwordPage.getOldPassword(), passwordPage.getNewPassword()); |
... | ... | |
74 | 77 |
internalConversation.close(); |
75 | 78 |
return true; |
76 | 79 |
}catch(AccessDeniedException e){ |
77 |
MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
|
|
80 |
MessagingUtils.warningDialog(warningTitle, this, warningMessage);
|
|
78 | 81 |
return false; |
79 | 82 |
}catch (AuthenticationException e){ |
80 |
MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
|
|
83 |
MessagingUtils.warningDialog(warningTitle, this, warningMessage);
|
|
81 | 84 |
|
82 | 85 |
return false; |
83 | 86 |
}catch(Exception e){ |
84 |
MessagingUtils.warningDialog("Problem with changing password", this, "The password could not be changed. " + e.getMessage());
|
|
87 |
MessagingUtils.warningDialog(Messages.PasswordWizard_PROBLEM_WITH_CHANGING_PWD, this, Messages.PasswordWizard_PWD_COULD_NOT_BE_CHANGED + e.getMessage());
|
|
85 | 88 |
return false; |
86 | 89 |
}finally{ |
87 | 90 |
if(conversation != null){ |
Also available in: Unified diff
i18n for changing password #3102