Class CmsLoginHelper

java.lang.Object
org.opencms.workplace.CmsWorkplace
org.opencms.workplace.CmsLoginHelper

public class CmsLoginHelper extends org.opencms.workplace.CmsWorkplace
Handles front-end login of users to the OpenCms workplace into the given site and project.

Since:
7.0.3
  • Field Summary

    Fields inherited from class org.opencms.workplace.CmsWorkplace

    DEBUG, DEFAULT_DATE_STRING, DEFAULT_LANGUAGE, DEFAULT_LOCALE, DIALOG_PATH_COMMON, FILE_DIALOG_CLOSE, FILE_DIALOG_SCREEN_CONFIRM, FILE_DIALOG_SCREEN_ERROR, FILE_DIALOG_SCREEN_ERRORPAGE, FILE_DIALOG_SCREEN_WAIT, FILE_EXPLORER_FILELIST, FILE_REPORT_OUTPUT, HTML_END, HTML_START, INPUT_DEFAULT, INPUT_NONE, JSP_WORKPLACE_URI, PARAM_DIRECTPUBLISH, PARAM_MODELFILE, PARAM_NEWRESOURCETYPE, PARAM_PUBLISHSIBLINGS, PARAM_RELATEDRESOURCES, PARAM_RESOURCELIST, PARAM_SUBRESOURCES, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PARAM_WP_START, PARAM_WP_VIEW, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RES_PATH_FILETYPES, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODELDIALOG, VFS_PATH_MODULES, VFS_PATH_NEWRESOURCEDIALOG, VFS_PATH_RESOURCES, VFS_PATH_SITES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE, VIEW_ADMIN, VIEW_DIRECT_EDIT, VIEW_EXPLORER, VIEW_GALLERY, VIEW_LIST, VIEW_WORKPLACE
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmsLoginHelper(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
    Public constructor with JSP variables.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    org.opencms.main.CmsException
    Returns the loginException.
    Returns the formatted stack trace.
    protected void
    initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
     
    boolean
    login(String userName, String password, String projectName, String siteRoot, String resourceName)
    Logs the user into the given project and site.

    Methods inherited from class org.opencms.workplace.CmsWorkplace

    addMessages, addMessages, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, canEditPermissionsForRoles, checkLock, checkLock, decodeParamValue, fillParamValues, fillParamValues, generateCssStyle, generatePageEndExtended, generatePageEndSimple, generatePageStartExtended, generatePageStartSimple, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStartSiteRoot, getStartSiteRoot, getStaticResourceUri, getStaticResourceUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, getWorkplaceExplorerLink, getWorkplaceExplorerLink, getWorkplaceSettings, htmlEnd, htmlStart, initMessages, initSettings, initTimeWarp, initUserSettings, initWorkplaceMembers, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, key, key, keyDefault, nullToEmpty, pageBody, pageHtml, pageHtmlStyle, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, substituteSiteTitle, substituteSiteTitleStatic, switchToCurrentProject, switchToTempProject, updateUserPreferences

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CmsLoginHelper

      public CmsLoginHelper(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
      Public constructor with JSP variables.

      Parameters:
      context - the JSP page context
      req - the JSP request
      res - the JSP response
  • Method Details

    • getLoginException

      public org.opencms.main.CmsException getLoginException()
      Returns the loginException.

      Returns:
      the loginException
    • getStacktrace

      Returns the formatted stack trace.

      Returns:
      the formatted stack trace
    • login

      public boolean login(String userName, String password, String projectName, String siteRoot, String resourceName)
      Logs the user into the given project and site.

      Check the getLoginException() for the error message.

      Parameters:
      userName - the user name
      password - the password
      projectName - the optional project name, if null the default project is used
      siteRoot - the site of the resource, if null the default site is used
      resourceName - the resource to display
      Returns:
      true if the login has been successful
    • checkRole

      protected void checkRole()
      Overrides:
      checkRole in class org.opencms.workplace.CmsWorkplace
      See Also:
      • CmsWorkplace.checkRole()
    • initWorkplaceRequestValues

      protected void initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
      Specified by:
      initWorkplaceRequestValues in class org.opencms.workplace.CmsWorkplace
      See Also:
      • CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)