Search in sources :

Example 61 with MacroMachine

use of password.pwm.util.macro.MacroMachine in project pwm by pwm-project.

the class ActivateUserUtils method forwardToAgreementPage.

static void forwardToAgreementPage(final PwmRequest pwmRequest) throws ServletException, PwmUnrecoverableException, IOException {
    final String agreementText = pwmRequest.getConfig().readSettingAsLocalizedString(PwmSetting.ACTIVATE_AGREEMENT_MESSAGE, pwmRequest.getLocale());
    final MacroMachine macroMachine = MacroMachine.forUser(pwmRequest, ActivateUserServlet.userInfo(pwmRequest).getUserIdentity());
    final String expandedText = macroMachine.expandMacros(agreementText);
    pwmRequest.setAttribute(PwmRequestAttribute.AgreementText, expandedText);
    pwmRequest.forwardToJsp(JspUrl.ACTIVATE_USER_AGREEMENT);
}
Also used : MacroMachine(password.pwm.util.macro.MacroMachine)

Aggregations

MacroMachine (password.pwm.util.macro.MacroMachine)61 PwmUnrecoverableException (password.pwm.error.PwmUnrecoverableException)22 ErrorInformation (password.pwm.error.ErrorInformation)20 Locale (java.util.Locale)16 PwmOperationalException (password.pwm.error.PwmOperationalException)15 Configuration (password.pwm.config.Configuration)13 UserInfo (password.pwm.ldap.UserInfo)13 ArrayList (java.util.ArrayList)12 LinkedHashMap (java.util.LinkedHashMap)12 PwmApplication (password.pwm.PwmApplication)12 FormConfiguration (password.pwm.config.value.data.FormConfiguration)12 ChaiUser (com.novell.ldapchai.ChaiUser)10 PwmException (password.pwm.error.PwmException)10 List (java.util.List)9 EmailItemBean (password.pwm.bean.EmailItemBean)9 ChaiUnavailableException (com.novell.ldapchai.exception.ChaiUnavailableException)8 Map (java.util.Map)8 ActionConfiguration (password.pwm.config.value.data.ActionConfiguration)8 PwmSession (password.pwm.http.PwmSession)8 Instant (java.time.Instant)7