java/code/src/com/redhat/rhn/frontend/action/user/UserEditActionHelper.java | 18 +++++----- 1 file changed, 10 insertions(+), 8 deletions(-)
New commits: commit 08fea72e953e6e66cc9487b14a27f56585ef19b1 Author: Johannes Renner jrenner@suse.de Date: Mon Mar 28 13:45:25 2011 +0200
Do not show success message when passwords don't match
diff --git a/java/code/src/com/redhat/rhn/frontend/action/user/UserEditActionHelper.java b/java/code/src/com/redhat/rhn/frontend/action/user/UserEditActionHelper.java index 68f6ce0..c61fbc6 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/user/UserEditActionHelper.java +++ b/java/code/src/com/redhat/rhn/frontend/action/user/UserEditActionHelper.java @@ -40,16 +40,18 @@ public abstract class UserEditActionHelper extends RhnAction { //get validation errors ActionErrors errors = RhnValidationHelper.validateDynaActionForm(this, form);
- //Make sure password and passwordConfirm are equal + //Add an error in case of password mismatch + String pw = (String)form.get(UserActionHelper.DESIRED_PASS); + String conf = (String)form.get(UserActionHelper.DESIRED_PASS_CONFIRM); + if (!pw.equals(conf)) { + errors.add(ActionMessages.GLOBAL_MESSAGE, + new ActionMessage("error.password_mismatch")); + } + + //Make sure password is not the placeholder if (!UserActionHelper.PLACEHOLDER_PASSWORD.equals( form.get(UserActionHelper.DESIRED_PASS))) { - String pw = (String)form.get(UserActionHelper.DESIRED_PASS); - String conf = (String)form.get(UserActionHelper.DESIRED_PASS_CONFIRM); - if (!pw.equals(conf)) { - errors.add(ActionMessages.GLOBAL_MESSAGE, - new ActionMessage("error.password_mismatch")); - } - else if (errors.isEmpty()) { + if (errors.isEmpty()) { //Set the password only if there are no errors at all targetUser.setPassword(pw); }
spacewalk-commits@lists.fedorahosted.org