Search in sources :

Example 6 with PWResetQuestionModel

use of com.sun.identity.password.ui.model.PWResetQuestionModel in project OpenAM by OpenRock.

the class PWResetQuestionViewBean method beginResetPageDisplay.

/**
     * Begins password secret questions content
     *
     * @param event child display event
     * @return true if password reset secret questions question is to
     *         displayed, false otherwise
     */
public boolean beginResetPageDisplay(ChildDisplayEvent event) {
    PWResetQuestionModel model = (PWResetQuestionModel) getModel();
    String orgDN = (String) getPageSessionAttribute(ORG_DN);
    String userDN = (String) getPageSessionAttribute(USER_DN);
    return isPWResetEnabled() && model.isQuestionAvailable(userDN, orgDN) && !model.isUserLockout(userDN, orgDN);
}
Also used : PWResetQuestionModel(com.sun.identity.password.ui.model.PWResetQuestionModel)

Example 7 with PWResetQuestionModel

use of com.sun.identity.password.ui.model.PWResetQuestionModel in project OpenAM by OpenRock.

the class PWResetQuestionViewBean method forwardTo.

/**
     * Forwards to current view bean after populating questions. It
     * will forward to <code>PWResetUserValidationViewBean</code> if 
     * the user DN or organization does not exists.
     *
     * @param context request context
     */
public void forwardTo(RequestContext context) {
    String orgDN = (String) getPageSessionAttribute(ORG_DN);
    String userDN = (String) getPageSessionAttribute(USER_DN);
    ISLocaleContext localeContext = new ISLocaleContext();
    localeContext.setLocale(context.getRequest());
    java.util.Locale locale = localeContext.getLocale();
    if (orgDN == null || orgDN.length() == 0 || userDN == null || userDN.length() == 0) {
        PWResetUserValidationViewBean vb = (PWResetUserValidationViewBean) getViewBean(PWResetUserValidationViewBean.class);
        vb.forwardTo(context);
    } else {
        PWResetQuestionModel model = (PWResetQuestionModel) getModel();
        model.readPWResetProfile(orgDN);
        model.setUserLocale(locale.toString());
        populateQuestionsList(userDN, orgDN);
        super.forwardTo(context);
    }
}
Also used : ISLocaleContext(com.sun.identity.common.ISLocaleContext) PWResetQuestionModel(com.sun.identity.password.ui.model.PWResetQuestionModel)

Example 8 with PWResetQuestionModel

use of com.sun.identity.password.ui.model.PWResetQuestionModel in project OpenAM by OpenRock.

the class PWResetQuestionViewBean method populateQuestionsList.

private void populateQuestionsList(String userDN, String orgDN) {
    PWResetQuestionModel model = (PWResetQuestionModel) getModel();
    Map map = model.getSecretQuestions(userDN, orgDN);
    if (map == null || map.isEmpty()) {
        model.setNoQuestionsInfoMsg();
    }
}
Also used : Map(java.util.Map) PWResetQuestionModel(com.sun.identity.password.ui.model.PWResetQuestionModel)

Aggregations

PWResetQuestionModel (com.sun.identity.password.ui.model.PWResetQuestionModel)8 Map (java.util.Map)4 HiddenField (com.iplanet.jato.view.html.HiddenField)2 ISLocaleContext (com.sun.identity.common.ISLocaleContext)2 HashMap (java.util.HashMap)2 RequestContext (com.iplanet.jato.RequestContext)1 DatasetModel (com.iplanet.jato.model.DatasetModel)1 ModelControlException (com.iplanet.jato.model.ModelControlException)1 PWResetException (com.sun.identity.password.ui.model.PWResetException)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1