Class UserCanTryAgainToLoginVerifier


  • public class UserCanTryAgainToLoginVerifier
    extends Object
    Class that provides tools to verify if the user can try to log in one more time after a login error.
    Author:
    Yohann Chastagnier Date: 05/02/13
    • Field Detail

      • settings

        protected static final org.silverpeas.kernel.bundle.SettingBundle settings
      • otherSettings

        protected static final org.silverpeas.kernel.bundle.SettingBundle otherSettings
    • Method Detail

      • isActivated

        public boolean isActivated()
        Indicates if the verifier is activated.
        Returns:
        true if this verifier has to be used. False otherwise.
      • performRequestUrl

        public String performRequestUrl​(javax.servlet.http.HttpServletRequest request,
                                        String originalUrl)
        Performs request and an original url.
        Parameters:
        request - the incoming HTTP request for login.
        originalUrl - the URL at which the user should be directed if all is ok.
        Returns:
        the actual destination URL once this verifier completed its work.
      • getMessage

        public String getMessage()
        Gets the (warning) message according to connection attempts.
        Returns:
        the message to render to the user for its login attempt.
      • getErrorDestination

        public String getErrorDestination()
        Gets the error destination.
        Returns:
        relative URL of the web page for login errors.
      • clearSession

        public void clearSession​(javax.servlet.http.HttpServletRequest request)
        Clearing the HTTP session.
      • get

        protected static UserCanTryAgainToLoginVerifier get​(User user)
        Gets a verifier of user connection for the specified user.
        Parameters:
        user - the user behind the login attempt.
        Returns:
        an instance of this verifier for the given user.
      • 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