Class PasswordExpiry

java.lang.Object
org.apache.wiki.auth.PasswordExpiry

public final class PasswordExpiry extends Object
Decides when a password is too old, as set by "jspwiki.credentials.expiry.days". It is off unless a number of days is configured. Only the profiles of the wiki's user database have a password that can expire; it is the date the password was last changed (UserProfile.getPasswordChanged()) that counts.
Since:
3.0.1
  • Field Details

    • PROP_EXPIRY_DAYS

      public static final String PROP_EXPIRY_DAYS
      Property with the number of days after which a password expires. Zero, the default, means that passwords do not expire.
      See Also:
  • Constructor Details

  • Method Details

    • getDays

      public int getDays()
      Returns the number of days after which a password expires.
      Returns:
      the number of days, or 0 if passwords do not expire
    • isEnabled

      public boolean isEnabled()
      Tells if passwords expire.
      Returns:
      true if a number of days is configured
    • isExpired

      public boolean isExpired(UserProfile profile, Date now)
      Tells if the password of a profile is older than the configured number of days. The password of a profile that does not know when it was changed does not expire.
      Parameters:
      profile - the profile
      now - the current time
      Returns:
      true if passwords expire and the password of the profile has