import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.Messages;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
public PasswordWizard(User user, ConversationHolder conversation){
this.conversation = conversation;
this.user = user;
- setWindowTitle("Change password");
+ setWindowTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
}
@Override
ConversationHolder internalConversation = CdmStore.getCurrentApplicationConfiguration().NewConversation();
internalConversation.bind();
internalConversation.startTransaction();
- try{
+ String warningTitle = Messages.PasswordWizard_COULD_NOT_CHANGE_PWD;
+ String warningMessage = Messages.PasswordWizard_OLD_PWD_INCORRECT;
+ try{
if(passwordPage.isChangingOwnPassword()){
// change own password with validating of old one
CdmStore.getService(IUserService.class).changePassword(passwordPage.getOldPassword(), passwordPage.getNewPassword());
internalConversation.close();
return true;
}catch(AccessDeniedException e){
- MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
+ MessagingUtils.warningDialog(warningTitle, this, warningMessage);
return false;
}catch (AuthenticationException e){
- MessagingUtils.warningDialog("Could not change password", this, "The old password is not correct.");
+ MessagingUtils.warningDialog(warningTitle, this, warningMessage);
return false;
}catch(Exception e){
- MessagingUtils.warningDialog("Problem with changing password", this, "The password could not be changed. " + e.getMessage());
+ MessagingUtils.warningDialog(Messages.PasswordWizard_PROBLEM_WITH_CHANGING_PWD, this, Messages.PasswordWizard_PWD_COULD_NOT_BE_CHANGED + e.getMessage());
return false;
}finally{
if(conversation != null){