Class UserBean

java.lang.Object
io.goobi.viewer.managedbeans.UserBean
All Implemented Interfaces:
Serializable

@Named @SessionScoped public class UserBean extends Object implements Serializable
Primarily for user authentication.
See Also:
  • Constructor Details

    • UserBean

      public UserBean()
      Empty constructor.
  • Method Details

    • updateSessionTimeoutCounter

      public void updateSessionTimeoutCounter()

      updateSessionTimeoutCounter.

    • getSessionTimeout

      public String getSessionTimeout()

      getSessionTimeout.

      Returns:
      a String object
    • createNewUserAccount

      public String createNewUserAccount() throws DAOException
      Creates and persists a new local User.
      Returns:
      a String object.
      Throws:
      DAOException - if any.
    • activateUserAccountAction

      public String activateUserAccountAction() throws DAOException

      activateUserAccountAction.

      Returns:
      a String object.
      Throws:
      DAOException - if any.
    • login

      Login action method for local accounts.
      Returns:
      the url mapping to navigate to
      Throws:
      AuthenticationProviderException - if any.
      IllegalStateException - if any.
      InterruptedException - if any.
      ExecutionException - if any.
    • login

      login.

      Parameters:
      provider - a IAuthenticationProvider object.
      Returns:
      a String object.
      Throws:
      IllegalStateException - if any.
      AuthenticationProviderException - if any.
      InterruptedException - if any.
      ExecutionException - if any.
    • logout

      public String logout() throws AuthenticationProviderException
      Logout action method.
      Returns:
      a String object.
      Throws:
      AuthenticationProviderException - if any.
    • wipeSession

      public void wipeSession(javax.servlet.http.HttpServletRequest request) throws IndexUnreachableException, PresentationException, DAOException
      Removes the user and permission attributes from the session.
      Parameters:
      request - a HttpServletRequest object.
      Throws:
      IndexUnreachableException - if any.
      PresentationException - if any.
      DAOException - if any.
    • getAllUsers

      public List<User> getAllUsers() throws DAOException
      Returns a list of all existing users (minus the superusers and the current user).
      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • sendPasswordResetLinkAction

      public String sendPasswordResetLinkAction() throws DAOException
      Sends a password reset link to the current e-mail address.
      Returns:
      a String object.
      Throws:
      DAOException - if any.
    • resetPasswordAction

      public String resetPasswordAction() throws DAOException
      Generates a new user password if the key is correct.
      Returns:
      a String object.
      Throws:
      DAOException - if any.
    • transkribusLoginAction

      public String transkribusLoginAction()

      transkribusLoginAction.

      Returns:
      a String object.
    • getUser

      public User getUser()

      Getter for the field user.

      Returns:
      the user
    • setUser

      public void setUser(User user)

      Setter for the field user.

      Parameters:
      user - the user to set
    • getNickName

      public String getNickName()

      Getter for the field nickName.

      Returns:
      the nickName
    • setNickName

      public void setNickName(String nickName)

      Setter for the field nickName.

      Parameters:
      nickName - the nickName to set
    • getEmail

      public String getEmail()

      Getter for the field email.

      Returns:
      the email
    • setEmail

      public void setEmail(String email)

      Setter for the field email.

      Parameters:
      email - the email to set
    • getPassword

      public String getPassword()

      Getter for the field password.

      Returns:
      the password
    • setPassword

      public void setPassword(String password)

      Setter for the field password.

      Parameters:
      password - the password to set
    • isLoggedIn

      public boolean isLoggedIn()

      isLoggedIn.

      Returns:
      a boolean.
    • isAdmin

      public boolean isAdmin()

      isAdmin.

      Returns:
      a boolean.
    • isUserRegistrationEnabled

      public boolean isUserRegistrationEnabled()

      isUserRegistrationEnabled.

      Returns:
      a boolean.
    • isShowOpenId

      public boolean isShowOpenId()

      isShowOpenId.

      Returns:
      a boolean.
    • getAuthenticationProviders

      public List<IAuthenticationProvider> getAuthenticationProviders()

      Getter for the field authenticationProviders.

      Returns:
      a List object.
    • getLocalAuthenticationProvider

      public IAuthenticationProvider getLocalAuthenticationProvider()

      getLocalAuthenticationProvider.

      Returns:
      a IAuthenticationProvider object.
    • getXserviceAuthenticationProvider

      public IAuthenticationProvider getXserviceAuthenticationProvider()

      getXserviceAuthenticationProvider.

      Returns:
      a IAuthenticationProvider object.
    • showAuthenticationProviderSelection

      public boolean showAuthenticationProviderSelection()

      showAuthenticationProviderSelection.

      Returns:
      a boolean
    • setAuthenticationProvider

      public void setAuthenticationProvider(IAuthenticationProvider provider)

      Setter for the field authenticationProvider.

      Parameters:
      provider - a IAuthenticationProvider object.
    • getAuthenticationProvider

      public IAuthenticationProvider getAuthenticationProvider()

      Getter for the field authenticationProvider.

      Returns:
      a IAuthenticationProvider object.
    • setAuthenticationProviderName

      public void setAuthenticationProviderName(String name)

      setAuthenticationProviderName.

      Parameters:
      name - a String object.
    • getAuthenticationProviderName

      public String getAuthenticationProviderName()

      getAuthenticationProviderName.

      Returns:
      a String object.
    • getPasswordOne

      public String getPasswordOne()

      Getter for the field passwordOne.

      Returns:
      a String object.
    • setPasswordOne

      public void setPasswordOne(String passwordOne)

      Setter for the field passwordOne.

      Parameters:
      passwordOne - a String object.
    • getPasswordTwo

      public String getPasswordTwo()

      Getter for the field passwordTwo.

      Returns:
      a String object.
    • setPasswordTwo

      public void setPasswordTwo(String passwordTwo)

      Setter for the field passwordTwo.

      Parameters:
      passwordTwo - a String object.
    • resetPasswordFields

      public void resetPasswordFields()

      resetPasswordFields.

    • getLastName

      public String getLastName()

      Getter for the field lastName.

      Returns:
      the lastName
    • setLastName

      public void setLastName(String lastName)

      Setter for the field lastName.

      Parameters:
      lastName - the lastName to set
    • getRedirectUrl

      public String getRedirectUrl()

      Getter for the field redirectUrl.

      Returns:
      the redirectUrl
    • setRedirectUrl

      public void setRedirectUrl(String redirectUrl)

      Setter for the field redirectUrl.

      Parameters:
      redirectUrl - the redirectUrl to set
    • getActivationKey

      public String getActivationKey()

      Getter for the field activationKey.

      Returns:
      the activationKey
    • setActivationKey

      public void setActivationKey(String activationKey)

      Setter for the field activationKey.

      Parameters:
      activationKey - the activationKey to set
    • getTranskribusUserName

      public String getTranskribusUserName()

      Getter for the field transkribusUserName.

      Returns:
      the transkribusUserName
    • setTranskribusUserName

      public void setTranskribusUserName(String transkribusUserName)

      Setter for the field transkribusUserName.

      Parameters:
      transkribusUserName - the transkribusUserName to set
    • getTranskribusPassword

      public String getTranskribusPassword()

      Getter for the field transkribusPassword.

      Returns:
      the transkribusPassword
    • setTranskribusPassword

      public void setTranskribusPassword(String transkribusPassword)

      Setter for the field transkribusPassword.

      Parameters:
      transkribusPassword - the transkribusPassword to set
    • getHasAdminBackendAccess

      public Boolean getHasAdminBackendAccess() throws PresentationException, IndexUnreachableException, DAOException
      Checks whether the logged in user has access to the admin backend via being an admin or having CMS/campaign/comments access. Result is persisted for the duration of the session.
      Returns:
      the hasAdminBackendAccess
      Throws:
      DAOException
      IndexUnreachableException
      PresentationException
    • setHasAdminBackendAccess

      public void setHasAdminBackendAccess(Boolean hasAdminBackendAccess)

      Setter for the field hasAdminBackendAccess.

      Parameters:
      hasAdminBackendAccess - the hasAdminBackendAccess to set
    • userEquals

      public boolean userEquals(long id)

      userEquals.

      Parameters:
      id - a long.
      Returns:
      a boolean.
    • hasProvidersOfType

      public boolean hasProvidersOfType(String type)

      hasProvidersOfType.

      Parameters:
      type - a String object.
      Returns:
      a boolean.
    • getProvidersOfType

      public List<IAuthenticationProvider> getProvidersOfType(String type)

      getProvidersOfType.

      Parameters:
      type - a String object.
      Returns:
      a List object.
    • getNumberOfProviderTypes

      public int getNumberOfProviderTypes()

      getNumberOfProviderTypes.

      Returns:
      a int.
    • isAllowPasswordChange

      public boolean isAllowPasswordChange()

      isAllowPasswordChange.

      Returns:
      a boolean.
    • isAllowNickNameChange

      public boolean isAllowNickNameChange()

      isAllowNickNameChange.

      Returns:
      a boolean.
    • isAllowEmailChange

      public boolean isAllowEmailChange()

      isAllowEmailChange.

      Returns:
      a boolean.
    • isRequireLoginCaptcha

      public boolean isRequireLoginCaptcha()

      isRequireLoginCaptcha.

      Returns:
      a boolean
    • mustAgreeToTermsOfUse

      public boolean mustAgreeToTermsOfUse()
      Check if the current user is required to agree to the terms of use
      Returns:
      true if a user is logged in and User.isAgreedToTermsOfUse() returns false for this user
    • agreeToTermsOfUse

      public void agreeToTermsOfUse() throws DAOException

      agreeToTermsOfUse.

      Throws:
      DAOException - if any.
    • rejectTermsOfUse

      public void rejectTermsOfUse() throws DAOException

      rejectTermsOfUse.

      Throws:
      DAOException - if any.
    • logoutWithMessage

      public void logoutWithMessage(String messageKey) throws AuthenticationProviderException

      logoutWithMessage.

      Parameters:
      messageKey - a String object
      Throws:
      AuthenticationProviderException - if any.
    • createBackupOfCurrentUser

      public void createBackupOfCurrentUser()

      createBackupOfCurrentUser.