// Not all required fields are set
throw new IllegalArgumentException("this.userName is empty"); //NOI18N
} else if (((!this.getUserPassword().isEmpty()) || (!this.getUserPasswordRepeat().isEmpty())) && (!this.isSamePasswordEntered())) {
- // Not same password entered
+ // Clear password fields
this.setUserPassword(null);
this.setUserPasswordRepeat(null);
- // Throw exception
- throw new FaceletException("Not same password entered"); //NOI18N
+ // Not same password entered
+ this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_PASSWORD_REPEAT_DIFFERENT"); //NOI18N
+ return ""; //NOI18N
} else if ((!Objects.equals(user.getUserName(), this.getUserName())) && (this.userBean.ifUserNameExists(this.getUserName()))) {
+ // Clear all fields
+ this.clear();
+
// User name already exists
- throw new FaceletException(new UserNameAlreadyRegisteredException(this.getUserName()));
+ this.showFacesMessage("form_edit_user:userName", "ADMIN_USER_NAME_ALREADY_EXISTS"); //NOI18N
+ return ""; //NOI18N
} else if (this.isSamePasswordEntered()) {
// Same password entered, create container
- if (UserUtils.ifPasswordMatches(new UserLoginContainer(user, this.getUserPassword()))) {
+ if ((Objects.equals(user.getUserMustChangePassword(), this.getUserMustChangePassword())) && (UserUtils.ifPasswordMatches(new UserLoginContainer(user, this.getUserPassword())))) {
+ // Clear password fields
+ this.setUserPassword(null);
+ this.setUserPasswordRepeat(null);
+
// Same password entered
- throw new FaceletException("Same password as stored entered."); //NOI18N
+ this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD"); //NOI18N
+ return ""; //NOI18N
}
// Encrypt password
ADMIN_ACTIVITY_ADMIN_DELETED_USER_ACCOUNT=Benutzeraccount gel\u00f6scht vom Administrator.
USER_ACTIVITY_ADMIN_DELETED_USER_ACCOUNT=Ihr Benutzeraccount wurde von einem Administrator gel\u00f6scht.
ADMIN_USER_DELETE_REASON=L\u00f6schgrund: (optional)
+ADMIN_USER_PASSWORD_REPEAT_DIFFERENT=Your both entered passwords don't match.
+ADMIN_USER_NAME_ALREADY_EXISTS=Your entered user name does already exist in other user account.
+ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD=You have not changed the password (same as stored entered)
ADMIN_ACTIVITY_ADMIN_DELETED_USER_ACCOUNT=User account has been deleted by administrator.
USER_ACTIVITY_ADMIN_DELETED_USER_ACCOUNT=Your account has been deleted by an administrator.
ADMIN_USER_DELETE_REASON=Delete reason: (optional)
+ADMIN_USER_PASSWORD_REPEAT_DIFFERENT=Die beiden von Ihnen eingegebenen Passw\u00f6rter stimmen nicht \u00fcberein.
+ADMIN_USER_NAME_ALREADY_EXISTS=Der von Ihnen eingegebene Benutzername existiert bereits (anderes Benutzeraccount).
+ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD=Sie haben das Passwort nicht ge\u00e4ndert (selibiges wie gespeichertes).