Package org.apache.wiki.auth
Class PasswordExpiry
java.lang.Object
org.apache.wiki.auth.PasswordExpiry
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty with the number of days after which a password expires. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetDays()Returns the number of days after which a password expires.booleanTells if passwords expire.booleanisExpired(UserProfile profile, Date now) Tells if the password of a profile is older than the configured number of days.
-
Field Details
-
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
-
PasswordExpiry
Reads "jspwiki.credentials.expiry.days". A value that is not a number, or is negative, is logged and passwords do not expire.- Parameters:
props- the wiki properties
-
-
Method Details
-
getDays
Returns the number of days after which a password expires.- Returns:
- the number of days, or 0 if passwords do not expire
-
isEnabled
Tells if passwords expire.- Returns:
trueif a number of days is configured
-
isExpired
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 profilenow- the current time- Returns:
trueif passwords expire and the password of the profile has
-