Search in sources :

Example 11 with ChangePasswordBean

use of password.pwm.http.bean.ChangePasswordBean in project pwm by pwm-project.

the class ChangePasswordServlet method processCheckProgressAction.

@ActionHandler(action = "checkProgress")
ProcessStatus processCheckProgressAction(final PwmRequest pwmRequest) throws ServletException, PwmUnrecoverableException, IOException {
    final ChangePasswordBean changePasswordBean = pwmRequest.getPwmApplication().getSessionStateService().getBean(pwmRequest, ChangePasswordBean.class);
    final PasswordChangeProgressChecker.ProgressTracker progressTracker = changePasswordBean.getChangeProgressTracker();
    final PasswordChangeProgressChecker.PasswordChangeProgress passwordChangeProgress;
    if (progressTracker == null) {
        passwordChangeProgress = PasswordChangeProgressChecker.PasswordChangeProgress.COMPLETE;
    } else {
        final PasswordChangeProgressChecker checker = new PasswordChangeProgressChecker(pwmRequest.getPwmApplication(), pwmRequest.getPwmSession().getUserInfo().getUserIdentity(), pwmRequest.getSessionLabel(), pwmRequest.getLocale());
        passwordChangeProgress = checker.figureProgress(progressTracker);
    }
    final RestResultBean restResultBean = RestResultBean.withData(passwordChangeProgress);
    LOGGER.trace(pwmRequest, "returning result for restCheckProgress: " + JsonUtil.serialize(restResultBean));
    pwmRequest.outputJsonResult(restResultBean);
    return ProcessStatus.Halt;
}
Also used : ChangePasswordBean(password.pwm.http.bean.ChangePasswordBean) PasswordChangeProgressChecker(password.pwm.ldap.PasswordChangeProgressChecker) RestResultBean(password.pwm.ws.server.RestResultBean)

Aggregations

ChangePasswordBean (password.pwm.http.bean.ChangePasswordBean)11 PwmApplication (password.pwm.PwmApplication)4 PwmSession (password.pwm.http.PwmSession)4 PasswordChangeProgressChecker (password.pwm.ldap.PasswordChangeProgressChecker)4 PwmOperationalException (password.pwm.error.PwmOperationalException)3 UserInfo (password.pwm.ldap.UserInfo)3 LoginInfoBean (password.pwm.bean.LoginInfoBean)2 FormConfiguration (password.pwm.config.value.data.FormConfiguration)2 PwmDataValidationException (password.pwm.error.PwmDataValidationException)2 PwmUnrecoverableException (password.pwm.error.PwmUnrecoverableException)2 PasswordData (password.pwm.util.PasswordData)2 MacroMachine (password.pwm.util.macro.MacroMachine)2 ChaiUser (com.novell.ldapchai.ChaiUser)1 ChaiUnavailableException (com.novell.ldapchai.exception.ChaiUnavailableException)1 IOException (java.io.IOException)1 Instant (java.time.Instant)1 Locale (java.util.Locale)1 ServletException (javax.servlet.ServletException)1 LocalSessionStateBean (password.pwm.bean.LocalSessionStateBean)1 Configuration (password.pwm.config.Configuration)1