/** * Returns the currently logged in user.<p> * * @return the currently logged in user */ public CmsUser getUser() { return getRequestContext().getCurrentUser(); }
/** * Returns the currently logged in user.<p> * * @return the currently logged in user */ public CmsUser getUser() { return getRequestContext().currentUser(); }
/** * Returns the link to the form that contains the login element.<p> * * @return the link to the form that contains the login element */ public String getFormLink() { return link(getRequestContext().getUri()); }
/** * Returns the link to the form that contains the login element.<p> * * @return the link to the form that contains the login element */ public String getFormLink() { return link(getRequestContext().getUri()); }
/** * Returns the user name of the currently logged in user.<p> * * @return the user name of the currently logged in user */ public String getUserName() { return getRequestContext().getCurrentUser().getName(); }
/** * Returns the user name of the currently logged in user.<p> * * @return the user name of the currently logged in user */ public String getUserName() { return getRequestContext().currentUser().getName(); }
/** * Logs a user out, i.e. destroys the current users session, * after that the current page will be redirected to itself one time to ensure that * the users session is truly destroyed.<p> * * @throws IOException if redirect after logout fails */ public void logout() throws IOException { HttpSession session = getRequest().getSession(false); if (session != null) { session.invalidate(); } // logout was successful if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key( Messages.LOG_LOGOUT_SUCCESFUL_3, getRequestContext().currentUser().getName(), getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); } getResponse().sendRedirect(getFormLink()); } }
/** * Logs a user out, i.e. destroys the current users session, * after that the current page will be redirected to itself one time to ensure that * the users session is truly destroyed.<p> * * @throws IOException if redirect after logout fails */ public void logout() throws IOException { String loggedInUserName = getRequestContext().getCurrentUser().getName(); HttpSession session = getRequest().getSession(false); if (session != null) { session.invalidate(); /* we need this because a new session might be created after this method, but before the session info is updated in OpenCmsCore.showResource. */ getCmsObject().getRequestContext().setUpdateSessionEnabled(false); } // logout was successful if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_LOGOUT_SUCCESFUL_3, loggedInUserName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); } getResponse().sendRedirect(getFormLink()); } }
getCmsObject().loginUser(userName, password, getRequestContext().getRemoteAddress()); Messages.LOG_LOGIN_SUCCESSFUL_3, userName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); Messages.LOG_LOGIN_FAILED_DISABLED_3, userName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); new Object[] { userName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress(), m_loginException.getMessageContainer().getArgs()[2], m_loginException.getMessageContainer().getArgs()[3]})); Messages.LOG_LOGIN_FAILED_NO_USER_3, userName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); new Object[] { userName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress(), new Date(endTime)}));
getCmsObject().loginUser(userName, password, getRequestContext().getRemoteAddress()); Messages.LOG_LOGIN_SUCCESSFUL_3, userName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); logLoginException(getRequestContext(), userName, currentLoginException);