Repository: ranger Updated Branches: refs/heads/master 6d310e23f -> d24b9a15b
RANGER-2282: The error message for changing password is incorrect in User Profile page. Signed-off-by: peng.jianhua <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/d24b9a15 Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/d24b9a15 Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/d24b9a15 Branch: refs/heads/master Commit: d24b9a15bdc53539cf4e481bfadd7cc42fa7d229 Parents: 6d310e2 Author: zhangqiang2 <[email protected]> Authored: Tue Nov 13 10:48:04 2018 +0800 Committer: peng.jianhua <[email protected]> Committed: Wed Nov 21 14:00:38 2018 +0800 ---------------------------------------------------------------------- security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java | 4 ++-- security-admin/src/main/webapp/scripts/views/user/UserProfile.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/d24b9a15/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java index 2a638f8..9e45782 100644 --- a/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java +++ b/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java @@ -418,7 +418,7 @@ public class UserMgr { String encryptedOldPwd = encrypt(pwdChange.getLoginId(),pwdChange.getOldPassword()); if (!stringUtil.equals(encryptedOldPwd, gjUser.getPassword())) { logger.info("changePassword(). Invalid old password. LoginId="+ pwdChange.getLoginId()); - throw restErrorUtil.createRESTException("serverMsg.userMgrOldPassword",MessageEnums.INVALID_INPUT_DATA, null, null,pwdChange.getLoginId()); + throw restErrorUtil.createRESTException("validationMessages.oldPasswordError",MessageEnums.INVALID_INPUT_DATA, null, null,pwdChange.getLoginId()); } //validate new password @@ -448,7 +448,7 @@ public class UserMgr { } else { ret.setMsgDesc("Password update failed"); ret.setStatusCode(VXResponse.STATUS_ERROR); - throw restErrorUtil.createRESTException("serverMsg.userMgrNewPassword",MessageEnums.INVALID_INPUT_DATA, gjUser.getId(),"password", gjUser.toString()); + throw restErrorUtil.createRESTException("serverMsg.userMgrOldPassword",MessageEnums.INVALID_INPUT_DATA, gjUser.getId(),"password", gjUser.toString()); } return ret; } http://git-wip-us.apache.org/repos/asf/ranger/blob/d24b9a15/security-admin/src/main/webapp/scripts/views/user/UserProfile.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/views/user/UserProfile.js b/security-admin/src/main/webapp/scripts/views/user/UserProfile.js index 8e60b53..408b311 100644 --- a/security-admin/src/main/webapp/scripts/views/user/UserProfile.js +++ b/security-admin/src/main/webapp/scripts/views/user/UserProfile.js @@ -171,7 +171,7 @@ define(function(require){ that.form.fields.newPassword.setError(localization.tt('validationMessages.newPasswordError')); that.form.fields.reEnterPassword.setError(localization.tt('validationMessages.newPasswordError')); }else if((msResponse.responseJSON.msgDesc) == "serverMsg.userMgrOldPassword"){ - that.form.fields.oldPassword.setError(localization.tt('validationMessages.oldPasswordRepeatError')); + that.form.fields.newPassword.setError(localization.tt('validationMessages.oldPasswordRepeatError')); }else if(msResponse.status == 419){ XAUtil.defaultErrorHandler(options , msResponse); } else {
