Class UserPasswordUtil

java.lang.Object
overit.geocall.base.util.UserPasswordUtil

public class UserPasswordUtil extends Object
  • Method Details

    • preparePassword

      public static void preparePassword(HashGetter newValues, HashGetter userValues)
      Utility method to prepare the password for saving. The new password and the used algorithm will be entered in the newValues HashGetter passed as first input. The method uses the password found inside the newValues HashGetter as new password to be crypt. If the new value password is null, the original password, extracted from the userValue HashGetter passed as second parameter, will be entered in the newValues HashGetter.
      Parameters:
      newValues - HashGetter contains the value. The password to adapt will be searched inside, and the adapted value will be inserted inside. The keys used are FIELD_AUTEPASS for password and FIELD_AUTEPASSALG for password algorithm.
      userValues - HashGetter contains the user original values, as current password to change.
    • validatePasswordConstraints

      public static void validatePasswordConstraints(String pass, Identity identity) throws DAValidateException
      Utility method used to check the max length, min length and if the password respect all the constraints.
      Parameters:
      pass - the password to check
      Throws:
      DAValidateException - if the password don't respect all the constraints
    • validatePasswordConstraints

      public static void validatePasswordConstraints(String pass, Identity identity, HashGetter values) throws DAValidateException
      Throws:
      DAValidateException
    • isPasswordChanged

      protected static boolean isPasswordChanged(String newPassword, boolean isNewUser)
      Utility that checks if the new password has changed from the old one saved
      Parameters:
      newPassword - the new password entered. If it is null, the password is not changed.
      isNewUser - boolean to indicate if it is a new user entry or an update
      Returns:
      true if the password is changed or it is the new user, otherwise false