use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class PWResetUserValidationViewBean method handleBtnNextRequest.
/**
* Handles form submission request
*
* @param event request invocation event
*/
public void handleBtnNextRequest(RequestInvocationEvent event) {
PWResetUserValidationModel model = (PWResetUserValidationModel) getModel();
String userAttrValue = (String) getDisplayFieldValue(TF_USER_ATTR);
if (userAttrValue != null) {
userAttrValue = userAttrValue.trim();
}
HiddenField hf = (HiddenField) getChild(FLD_USER_ATTR);
String userAttrName = (String) hf.getValue();
String orgDN = (String) getPageSessionAttribute(ORG_DN);
String orgDNFlag = (String) getPageSessionAttribute(ORG_DN_FLAG);
RequestContext reqContext = event.getRequestContext();
ISLocaleContext localeContext = new ISLocaleContext();
localeContext.setLocale(reqContext.getRequest());
java.util.Locale localeObj = localeContext.getLocale();
String locale = localeObj.toString();
model.setUserLocale(locale);
if (orgDNFlag != null && orgDNFlag.equals(STRING_TRUE)) {
model.setRealmFlag(true);
}
if (userAttrValue == null || userAttrValue.length() == 0) {
setErrorMessage(model.getErrorTitle(), model.getMissingUserAttrMessage(userAttrName));
forwardTo();
} else {
if (model.isUserAttrValueValid(orgDN, userAttrValue) && model.isUserExists(userAttrValue, userAttrName, orgDN) && model.isUserActive(model.getUserRealm())) {
forwardToPWResetQuestionVB(orgDN, userAttrValue, orgDNFlag, locale);
} else {
setErrorMessage(model.getErrorTitle(), model.getErrorMessage());
forwardTo();
}
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class ScriptUploaderViewBean method getModelInternal.
/**
* {@inheritDoc}
*/
@Override
protected AMModel getModelInternal() {
RequestContext rc = RequestManager.getRequestContext();
HttpServletRequest req = rc.getRequest();
return new AMModelBase(req, getPageSessionAttributes());
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class RedirectToRealmHomeViewBean method redirectToHome.
protected void redirectToHome() {
if (XuiRedirectHelper.isXuiAdminConsoleEnabled()) {
RequestContext rc = RequestManager.getRequestContext();
try {
String realm = URLEncoder.encode(rc.getRequest().getParameter("realm"), "UTF-8");
rc.getResponse().sendRedirect("../XUI#realms/" + realm + "/dashboard");
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("UTF-8 not supported", e);
} catch (IOException e) {
debug.message("Unexpected IOException during redirect", e);
}
} else {
HomeViewBean vb = (HomeViewBean) getViewBean(HomeViewBean.class);
backTrail();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class PWResetQuestionViewBean method handleBtnOKRequest.
/**
* Handles form submission request for next button. It will
* forward to <code>PWResetSuccessViewBean</code> if the answers
* are correct for the questions.
*
* @param event request invocation event
*/
public void handleBtnOKRequest(RequestInvocationEvent event) {
PWResetQuestionModel model = (PWResetQuestionModel) getModel();
String orgDN = (String) getPageSessionAttribute(ORG_DN);
String userDN = (String) getPageSessionAttribute(USER_DN);
RequestContext reqContext = event.getRequestContext();
ISLocaleContext localeContext = new ISLocaleContext();
localeContext.setLocale(reqContext.getRequest());
java.util.Locale localeObj = localeContext.getLocale();
String locale = localeObj.toString();
model.setUserLocale(locale);
PWResetQuestionTiledView tView = (PWResetQuestionTiledView) getChild(PASSWORD_RESET_TILEDVIEW);
Map map = tView.getAnswers();
if (tView.isAnswerBlank()) {
setErrorMessage(model.getErrorTitle(), model.getMissingAnswerMessage());
forwardTo();
} else {
try {
model.resetPassword(userDN, orgDN, map);
PWResetSuccessViewBean vb = (PWResetSuccessViewBean) getViewBean(PWResetSuccessViewBean.class);
vb.setResetMessage(model.getPasswordResetMessage());
vb.setPageSessionAttribute(URL_LOCALE, locale);
vb.forwardTo(getRequestContext());
} catch (PWResetException pwe) {
if (!model.isUserLockout(userDN, orgDN)) {
setErrorMessage(model.getErrorTitle(), pwe.getMessage());
}
forwardTo();
}
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class IDRepoViewBean method getModelInternal.
protected AMModel getModelInternal() {
RequestContext rc = RequestManager.getRequestContext();
HttpServletRequest req = rc.getRequest();
return new IDRepoModelImpl(req, getPageSessionAttributes());
}
Aggregations