Class CmsLoginHelper

    • Method Detail

      • getCopyrightHtml

        public static java.lang.String getCopyrightHtml​(java.util.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 java.lang.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

        public static java.util.List<CmsOrganizationalUnitgetOrgUnitsForLoginDialog​(CmsObject cms,
                                                                                      java.lang.String predefOu)
        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 java.lang.String getStartView​(CmsObject cms)
        Returns the start view.

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

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

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

        public static CmsWorkplaceSettings initSiteAndProject​(CmsObject cms)
        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​(java.lang.String pcType,
                                         java.lang.String username,
                                         java.lang.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

        public static CmsMessageContainer validateUserAndPasswordNotEmpty​(java.lang.String username,
                                                                          java.lang.String password)
        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,
                                                             java.lang.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