From e8d27c47b557d5e05eec928e6448a59c396ce4ae Mon Sep 17 00:00:00 2001 From: Jason Rivard Date: Sat, 13 Jan 2018 11:33:18 -0800 Subject: [PATCH] pom updates and hekpdesk pw set ui mode api check fix --- server/pom.xml | 10 +++++----- .../pwm/http/servlet/helpdesk/HelpdeskServlet.java | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/server/pom.xml b/server/pom.xml index adf0231b7..1b48d2a91 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -252,7 +252,7 @@ com.puppycrawl.tools checkstyle - 8.5 + 8.7 @@ -662,7 +662,7 @@ org.apache.commons commons-text - 1.1 + 1.2 org.apache.commons @@ -722,12 +722,12 @@ org.bouncycastle bcprov-jdk15on - 1.58 + 1.59 org.bouncycastle bcpkix-jdk15on - 1.58 + 1.59 javax.xml @@ -782,7 +782,7 @@ com.github.ben-manes.caffeine caffeine - 2.6.0 + 2.6.1 com.nulab-inc diff --git a/server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java b/server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java index f5eb4bbf2..77de819a0 100644 --- a/server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java +++ b/server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java @@ -1110,7 +1110,10 @@ public class HelpdeskServlet extends ControlledPwmServlet { ); final UserIdentity userIdentity = UserIdentity.fromKey(jsonInput.getUsername(), pwmRequest.getPwmApplication()); - final HelpdeskProfile helpdeskProfile = pwmRequest.getPwmSession().getSessionManager().getHelpdeskProfile(pwmRequest.getPwmApplication()); + final HelpdeskProfile helpdeskProfile = getHelpdeskProfile( pwmRequest ); + + HelpdeskServletUtil.checkIfUserIdentityViewable(pwmRequest, helpdeskProfile, userIdentity); + final ChaiUser chaiUser = getChaiUser(pwmRequest, getHelpdeskProfile(pwmRequest), userIdentity); final UserInfo userInfo = UserInfoFactory.newUserInfo( pwmRequest.getPwmApplication(), @@ -1120,18 +1123,15 @@ public class HelpdeskServlet extends ControlledPwmServlet { chaiUser.getChaiProvider() ); - HelpdeskServletUtil.checkIfUserIdentityViewable(pwmRequest, helpdeskProfile, userIdentity); - { - final HelpdeskUIMode mode = helpdeskProfile.readSettingAsEnum(PwmSetting.HELPDESK_CLEAR_RESPONSES, HelpdeskUIMode.class); + final HelpdeskUIMode mode = helpdeskProfile.readSettingAsEnum(PwmSetting.HELPDESK_SET_PASSWORD_MODE, HelpdeskUIMode.class); if (mode == HelpdeskUIMode.none) { throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_SECURITY_VIOLATION,"setting " - + PwmSetting.HELPDESK_CLEAR_RESPONSES.toMenuLocationDebug(helpdeskProfile.getIdentifier(), pwmRequest.getLocale()) + + PwmSetting.HELPDESK_SET_PASSWORD_MODE.toMenuLocationDebug(helpdeskProfile.getIdentifier(), pwmRequest.getLocale()) + " must not be set to none")); } } - final PasswordUtility.PasswordCheckInfo passwordCheckInfo = PasswordUtility.checkEnteredPassword( pwmRequest.getPwmApplication(), pwmRequest.getLocale(), @@ -1143,6 +1143,7 @@ public class HelpdeskServlet extends ControlledPwmServlet { ); final RestCheckPasswordServer.JsonOutput jsonResponse = RestCheckPasswordServer.JsonOutput.fromPasswordCheckInfo(passwordCheckInfo); + final RestResultBean restResultBean = RestResultBean.withData(jsonResponse); pwmRequest.outputJsonResult(restResultBean);