Class CmsLoginHelper


public class CmsLoginHelper extends CmsJspLoginBean
Utility to login users to the OpenCms workplace.

  • Field Details

  • Constructor Details

  • Method Details

    • getCopyrightHtml

      public static String getCopyrightHtml(Locale locale)
      Gets the copyright information HTML.

      Parameters:
      locale - the locale for which to get the copyright info
      Returns:
      the copyright info HTML
    • getDirectEditPath

      public static String getDirectEditPath(CmsObject cms, CmsUserSettings userSettings, boolean forceDirectEdit)
      Returns the direct edit path from the user settings, or null if not set.

      Parameters:
      cms - the CMS context to use
      userSettings - the user settings
      forceDirectEdit - true to ignore the start view
      Returns:
      the direct edit path
    • getLoginParameters

      public static CmsLoginHelper.LoginParameters getLoginParameters(CmsObject cms, javax.servlet.http.HttpServletRequest request, boolean workplaceUiRequest)
      Returns the login parameters for the current request.

      Parameters:
      cms - the cms context
      request - the request
      workplaceUiRequest - true if this is called from a workplace UI request
      Returns:
      the login parameters
    • getOrgUnitsForLoginDialog

      Gets the list of OUs which should be selectable in the login dialog.

      Parameters:
      cms - the CMS context to use
      predefOu - the predefined OU
      Returns:
      the list of organizational units for the OU selector
    • getStartView

      public static String getStartView(CmsObject cms)
      Returns the start view.

      Parameters:
      cms - the cms context
      Returns:
      the start view
    • getTitle

      public static String getTitle(Locale locale)
      Gets the window title for a given locale.

      Parameters:
      locale - the locale
      Returns:
      the window title
    • initSiteAndProject

      Initializes the site and project for a CMS context after login, and returns the workplace settings for the corresponding user.

      Parameters:
      cms - the CMS context which should be initialized
      Returns:
      the workplace set
    • setCookieData

      public static void setCookieData(String pcType, String username, String oufqn, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Sets the cookie data.

      Parameters:
      pcType - the pctype value
      username - the username value
      oufqn - the oufqn value
      request - the current request
      response - the current response
    • validateUserAndPasswordNotEmpty

      Checks that the user name and password are not empty, and returns an error message if they are.

      Parameters:
      username - the user name
      password - the password
      Returns:
      the error message, or null if the user name and password are OK
    • getCookie

      protected static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest request, String name)
      Returns the cookie with the given name, if not cookie is found a new one is created.

      Parameters:
      request - the current request
      name - the name of the cookie
      Returns:
      the cookie
    • setCookie

      protected static void setCookie(javax.servlet.http.Cookie cookie, boolean delete, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Sets the cookie in the response.

      Parameters:
      cookie - the cookie to set
      delete - flag to determine if the cookir should be deleted
      request - the current request
      response - the current response