Class UserMustAcceptTermsOfServiceVerifier
- java.lang.Object
-
- org.silverpeas.core.security.authentication.verifier.UserMustAcceptTermsOfServiceVerifier
-
public class UserMustAcceptTermsOfServiceVerifier extends Object
Class that provides tools to verify if the user must accept terms of service.- Author:
- Yohann Chastagnier Date: 10/09/13
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_USER_TOS_REFUSED
static String
ERROR_USER_TOS_TIMEOUT
protected static org.silverpeas.kernel.bundle.SettingBundle
otherSettings
protected static org.silverpeas.kernel.bundle.SettingBundle
settings
-
Constructor Summary
Constructors Modifier Constructor Description protected
UserMustAcceptTermsOfServiceVerifier(User user)
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UserMustAcceptTermsOfServiceVerifier
clearCache()
Clearing the cache associated to the verifier.protected static UserMustAcceptTermsOfServiceVerifier
get(String tosToken)
Gets the verifier with the given token.String
getDestination(javax.servlet.http.HttpServletRequest request)
Gets the destination.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
setUser(User user)
Sets the user.UserMustAcceptTermsOfServiceVerifier
verify()
Verify user connection attempts and block user account if necessary.
-
-
-
Field Detail
-
ERROR_USER_TOS_REFUSED
public static final String ERROR_USER_TOS_REFUSED
- See Also:
- Constant Field Values
-
ERROR_USER_TOS_TIMEOUT
public static final String ERROR_USER_TOS_TIMEOUT
- See Also:
- Constant Field Values
-
settings
protected static final org.silverpeas.kernel.bundle.SettingBundle settings
-
otherSettings
protected static final org.silverpeas.kernel.bundle.SettingBundle otherSettings
-
-
Constructor Detail
-
UserMustAcceptTermsOfServiceVerifier
protected UserMustAcceptTermsOfServiceVerifier(User user)
Default constructor.- Parameters:
user
- the user behind a login.
-
-
Method Detail
-
getDestination
public String getDestination(javax.servlet.http.HttpServletRequest request)
Gets the destination.- Returns:
- the relative URL of the web page displaying the terms of service once the user authenticated.
-
verify
public UserMustAcceptTermsOfServiceVerifier verify() throws AuthenticationUserMustAcceptTermsOfService
Verify user connection attempts and block user account if necessary.
-
clearCache
public UserMustAcceptTermsOfServiceVerifier clearCache()
Clearing the cache associated to the verifier.
-
get
protected static UserMustAcceptTermsOfServiceVerifier get(String tosToken)
Gets the verifier with the given token.- Parameters:
tosToken
- token mapped with aUserMustAcceptTermsOfServiceVerifier
instance.- Returns:
- a
UserMustAcceptTermsOfServiceVerifier
object.
-
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
-
-