public boolean isUserActive(String realm){
  boolean active=false;
  try {
    AMIdentity user=IdUtils.getIdentity(ssoToken,userId);
    boolean isUserActive=user.isActive();
    String loginStatus=getUserAttributeValue(user,USER_SERVICE_LOGIN_STATUS,ACTIVE);
    String lockout=getUserAttributeValue(user,USER_SERVICE_NS_LOCKOUT,STRING_FALSE);
    if (!isUserActive || !loginStatus.equalsIgnoreCase(ACTIVE) || !lockout.equalsIgnoreCase(STRING_FALSE)) {
      errorMsg=getLocalizedString("userNotActive.message");
      writeLog("accountInactive.message",userId);
    }
 else     if (isAccountExpired(user)) {
      errorMsg=getLocalizedString("userAccountExpired.message");
      writeLog("accountExpired.message",userId);
    }
 else     if (isUserLockout(userId,realm)) {
      String obj[]={userId};
      informationMsg=getLocalizedString("lockoutMsg.message");
      writeLog("accountLocked.message",userId);
    }
 else {
      active=true;
    }
  }
 catch (  SSOException e) {
    debug.warning("PWResetUserValidationModelImpl.isUserActive",e);
    errorMsg=getErrorString(e);
  }
catch (  IdRepoException e) {
    debug.warning("PWResetUserValidationModelImpl.isUserActive",e);
    errorMsg=getErrorString(e);
  }
  return active;
}

public boolean isUserActive ( String realm ) { boolean active = false ; try { AMIdentity user = IdUtils . getIdentity ( ssoToken , userId ) ; boolean isUserActive = user . isActive ( ) ; String loginStatus = getUserAttributeValue ( user , USER_SERVICE_LOGIN_STATUS , ACTIVE ) ; String lockout = getUserAttributeValue ( user , USER_SERVICE_NS_LOCKOUT , STRING_FALSE ) ; if ( ! isUserActive || ! loginStatus . equalsIgnoreCase ( ACTIVE ) || ! lockout . equalsIgnoreCase ( STRING_FALSE ) ) { errorMsg = getLocalizedString ( "userNotActive.message" ) ; writeLog ( "accountInactive.message" , userId ) ; } else if ( isAccountExpired ( user ) ) { errorMsg = getLocalizedString ( "userAccountExpired.message" ) ; writeLog ( "accountExpired.message" , userId ) ; } else if ( isUserLockout ( userId , realm ) ) { String obj [ ] = { userId } ; informationMsg = getLocalizedString ( "lockoutMsg.message" ) ; writeLog ( "accountLocked.message" , userId ) ; } else { active = true ; } } catch ( SSOException e ) { debug . warning ( "PWResetUserValidationModelImpl.isUserActive" , e ) ; errorMsg = getErrorString ( e ) ; } catch ( IdRepoException e ) { debug . warning ( "PWResetUserValidationModelImpl.isUserActive" , e ) ; errorMsg = getErrorString ( e ) ; } return active ; }
returns true if the user is active and account is not expired . this method will use the user dn stored in the model to determine if the user ' s account is active or has expired .
