Ejemplo n.º 1
0
  /** Return the hash algorithm to be used for new accounts */
  @Override
  protected void checkLegalPassword(String newPwd, String hash, boolean isAdmin)
      throws IllegalPasswordChange {
    super.checkLegalPassword(newPwd, hash, isAdmin);

    if (StringUtil.hasRepeatedChar(newPwd)) {
      throw new IllegalPassword("Password may not contain consecutive repeated characters");
    }
    if (!hasRequiredCharacterMix(newPwd)) {
      throw new IllegalPassword(
          "Password must contain mix of upper, lower, numeric and special characters");
    }
  }
Ejemplo n.º 2
0
 public UserAccount newUser(String name, AccountManager acctMgr, Configuration config) {
   UserAccount acct = new LCUserAccount(name);
   acct.init(acctMgr, config);
   return acct;
 }