Package org.opencms.ui.login
Class CmsLoginHelper
java.lang.Object
org.opencms.jsp.CmsJspBean
org.opencms.jsp.CmsJspActionElement
org.opencms.jsp.CmsJspLoginBean
org.opencms.ui.login.CmsLoginHelper
Utility to login users to the OpenCms workplace.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Holds the current login parameters. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Action constant: Default action, display the dialog.static final int
Action constant: Login successful.static final int
Action constant: Logout.static final String
The parameter name for the "getoulist" action.static final String
The parameter name for the "login" action.static final String
The parameter name for the "logout" action.static final String
Parameter name for the authorization token.static final String
The html id for the login form.static final String
The parameter name for the organizational unit.static final String
The parameter name for the search organizational unit.static final String
The parameter name for the password.static final String
The parameter name for the PC type.static final String
The parameter name for the organizational unit.static final String
Parameter used to open the 'send reset mail' view instead of the login dialog.static final String
The parameter name for the user name.static final String
The parameter name for the workplace data.static final String
PC type constant: private PC.static final String
PC type constant: public PC.Fields inherited from class org.opencms.jsp.CmsJspActionElement
NOT_INITIALIZED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static javax.servlet.http.Cookie
Returns the cookie with the given name, if not cookie is found a new one is created.static String
getCopyrightHtml
(Locale locale) Gets the copyright information HTML.static String
getDirectEditPath
(CmsObject cms, CmsUserSettings userSettings, boolean forceDirectEdit) Returns the direct edit path from the user settings, ornull
if not set.getLoginParameters
(CmsObject cms, javax.servlet.http.HttpServletRequest request, boolean workplaceUiRequest) Returns the login parameters for the current request.static List<CmsOrganizationalUnit>
getOrgUnitsForLoginDialog
(CmsObject cms, String predefOu) Gets the list of OUs which should be selectable in the login dialog.static String
getStartView
(CmsObject cms) Returns the start view.static String
Gets the window title for a given locale.static CmsWorkplaceSettings
Initializes the site and project for a CMS context after login, and returns the workplace settings for the corresponding user.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.static void
setCookieData
(String pcType, String username, String oufqn, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Sets the cookie data.static CmsMessageContainer
validateUserAndPasswordNotEmpty
(String username, String password) Checks that the user name and password are not empty, and returns an error message if they are.Methods inherited from class org.opencms.jsp.CmsJspLoginBean
getFormLink, getLoginException, getUser, getUserName, isLoggedIn, isLoginSuccess, login, login, login, logLoginException, logout, setVerificationCode
Methods inherited from class org.opencms.jsp.CmsJspActionElement
editable, editable, editable, editableManualClose, editableManualOpen, getContent, getContent, getMessages, getMessages, getMessages, getMessages, getNavigation, getNavigationUri, img, img, include, include, include, include, include, include, includeSilent, includeSilent, includeSilent, includeSilent, info, label, link, link, properties, properties, property, property, property, property, template, template, template, toAbsolute, user
Methods inherited from class org.opencms.jsp.CmsJspBean
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, handleMissingFlexController, init, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions
-
Field Details
-
ACTION_DISPLAY
Action constant: Default action, display the dialog.- See Also:
-
ACTION_LOGIN
Action constant: Login successful.- See Also:
-
ACTION_LOGOUT
Action constant: Logout.- See Also:
-
PARAM_ACTION_GETOULIST
The parameter name for the "getoulist" action.- See Also:
-
PARAM_ACTION_LOGIN
The parameter name for the "login" action.- See Also:
-
PARAM_ACTION_LOGOUT
The parameter name for the "logout" action.- See Also:
-
PARAM_AUTHTOKEN
Parameter name for the authorization token.- See Also:
-
PARAM_FORM
The html id for the login form.- See Also:
-
PARAM_OUFQN
The parameter name for the organizational unit.- See Also:
-
PARAM_OUSEARCH
The parameter name for the search organizational unit.- See Also:
-
PARAM_PASSWORD
The parameter name for the password.- See Also:
-
PARAM_PCTYPE
The parameter name for the PC type.- See Also:
-
PARAM_PREDEF_OUFQN
The parameter name for the organizational unit.- See Also:
-
PARAM_USERNAME
The parameter name for the user name.- See Also:
-
PARAM_RESET_PASSWORD
Parameter used to open the 'send reset mail' view instead of the login dialog.- See Also:
-
PARAM_WPDATA
The parameter name for the workplace data.- See Also:
-
PCTYPE_PRIVATE
PC type constant: private PC.- See Also:
-
PCTYPE_PUBLIC
PC type constant: public PC.- See Also:
-
-
Constructor Details
-
CmsLoginHelper
public CmsLoginHelper()
-
-
Method Details
-
getCopyrightHtml
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, ornull
if not set.- Parameters:
cms
- the CMS context to useuserSettings
- the user settingsforceDirectEdit
-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 contextrequest
- the requestworkplaceUiRequest
- 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 usepredefOu
- the predefined OU- Returns:
- the list of organizational units for the OU selector
-
getStartView
Returns the start view.- Parameters:
cms
- the cms context- Returns:
- the start view
-
getTitle
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 valueusername
- the username valueoufqn
- the oufqn valuerequest
- the current requestresponse
- 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 namepassword
- 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 requestname
- 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 setdelete
- flag to determine if the cookir should be deletedrequest
- the current requestresponse
- the current response
-