use of password.pwm.bean.LocalSessionStateBean in project pwm by pwm-project.
the class PwmRequest method getForwardUrl.
public String getForwardUrl() {
final LocalSessionStateBean ssBean = this.getPwmSession().getSessionStateBean();
String redirectURL = ssBean.getForwardURL();
if (redirectURL == null || redirectURL.length() < 1) {
redirectURL = this.getConfig().readSettingAsString(PwmSetting.URL_FORWARD);
}
if (redirectURL == null || redirectURL.length() < 1) {
redirectURL = this.getContextPath();
}
return redirectURL;
}
use of password.pwm.bean.LocalSessionStateBean in project pwm by pwm-project.
the class PwmSession method setLocale.
public boolean setLocale(final PwmApplication pwmApplication, final String localeString) throws PwmUnrecoverableException {
if (pwmApplication == null) {
throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_APP_UNAVAILABLE, "unable to read context manager"));
}
final LocalSessionStateBean ssBean = this.getSessionStateBean();
final List<Locale> knownLocales = pwmApplication.getConfig().getKnownLocales();
final Locale requestedLocale = LocaleHelper.parseLocaleString(localeString);
if (knownLocales.contains(requestedLocale) || "default".equalsIgnoreCase(localeString)) {
LOGGER.debug(this, "setting session locale to '" + localeString + "'");
ssBean.setLocale("default".equalsIgnoreCase(localeString) ? PwmConstants.DEFAULT_LOCALE : requestedLocale);
if (this.isAuthenticated()) {
this.reloadUserInfoBean(pwmApplication);
}
return true;
} else {
LOGGER.error(this, "ignoring unknown locale value set request for locale '" + localeString + "'");
ssBean.setLocale(PwmConstants.DEFAULT_LOCALE);
return false;
}
}
Aggregations