Class UserMustChangePasswordVerifier
- java.lang.Object
-
- org.silverpeas.core.security.authentication.verifier.UserMustChangePasswordVerifier
-
public class UserMustChangePasswordVerifier extends Object
Class that provides tools to verify if the user have to change his password or if the user will soon have to change his password.- Author:
- Yohann Chastagnier Date: 14/02/13
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
isMaxConnectionActivated
protected static boolean
isOffsetConnectionActivated
protected static boolean
isThatUserMustChangePasswordOnFirstLogin
protected static boolean
isThatUserMustFillEmailAddressOnFirstLogin
protected static int
nbMaxConnectionsForForcing
protected static int
nbMaxConnectionsForProposing
protected static org.silverpeas.kernel.bundle.SettingBundle
otherSettings
protected static org.silverpeas.kernel.bundle.SettingBundle
settings
-
Constructor Summary
Constructors Modifier Constructor Description protected
UserMustChangePasswordVerifier(User user)
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDestinationOnFirstLogin(javax.servlet.http.HttpServletRequest request)
Gets the destination on first login.protected static String
getString(String key, String language, String... params)
User
getUser()
Gets the user.protected static UserDetail
getUserById(String userId)
Gets a user from its identifier.void
notifyPasswordChange()
Notifies that user has changed his password.protected static void
setup(boolean userMustChangePasswordOnFirstLogin, boolean userMustFillEmailAddressOnFirstLogin, int nbSuccessfulUserConnectionsBeforeForcingPasswordChange, int nbSuccessfulUserConnectionsBeforeProposingToChangePassword)
Initializing settings.void
setUser(User user)
Sets the user.void
verify()
Verify if user has to change his password or if the user will soon be obliged to change his password.
-
-
-
Field Detail
-
isThatUserMustChangePasswordOnFirstLogin
protected static boolean isThatUserMustChangePasswordOnFirstLogin
-
isThatUserMustFillEmailAddressOnFirstLogin
protected static boolean isThatUserMustFillEmailAddressOnFirstLogin
-
isMaxConnectionActivated
protected static boolean isMaxConnectionActivated
-
isOffsetConnectionActivated
protected static boolean isOffsetConnectionActivated
-
nbMaxConnectionsForForcing
protected static int nbMaxConnectionsForForcing
-
nbMaxConnectionsForProposing
protected static int nbMaxConnectionsForProposing
-
settings
protected static final org.silverpeas.kernel.bundle.SettingBundle settings
-
otherSettings
protected static final org.silverpeas.kernel.bundle.SettingBundle otherSettings
-
-
Constructor Detail
-
UserMustChangePasswordVerifier
protected UserMustChangePasswordVerifier(User user)
Default constructor.- Parameters:
user
- the user behind a login.
-
-
Method Detail
-
setup
protected static void setup(boolean userMustChangePasswordOnFirstLogin, boolean userMustFillEmailAddressOnFirstLogin, int nbSuccessfulUserConnectionsBeforeForcingPasswordChange, int nbSuccessfulUserConnectionsBeforeProposingToChangePassword)
Initializing settings.
-
getDestinationOnFirstLogin
public String getDestinationOnFirstLogin(javax.servlet.http.HttpServletRequest request)
Gets the destination on first login.- Returns:
- the URL of the next web page for a first login according to some settings.
-
verify
public void verify() throws AuthenticationException
Verify if user has to change his password or if the user will soon be obliged to change his password.- Throws:
AuthenticationException
-
notifyPasswordChange
public void notifyPasswordChange()
Notifies that user has changed his password.
-
setUser
public void setUser(User user)
Sets the user.- Parameters:
user
- the user to set
-
getUser
public User getUser()
Gets the user.- Returns:
- the user
-
getUserById
protected static UserDetail getUserById(String userId)
Gets a user from its identifier.- Parameters:
userId
- the unique identifier of the user- Returns:
- the user
-
-