/** * Returns true if the security option should be displayed in the login dialog.<p> * * @return true if the security option should be displayed in the login dialog */ public boolean isShowSecure() { return OpenCms.getLoginManager().isEnableSecurity(); }
/** * Returns <code>true</code> if the login manager allows login.<p> * * @return if enabled */ private boolean isEnabled() { try { if ((m_engineState == CmsPublishEngineState.ENGINE_STOPPED) || (m_engineState == CmsPublishEngineState.ENGINE_STARTED)) { OpenCms.getLoginManager().checkLoginAllowed(); return true; } else { return false; } } catch (CmsAuthentificationException e) { return false; } } }
/** * Returns <code>true</code> if the login manager allows login.<p> * * @return if enabled */ private boolean isEnabled() { try { if ((m_engineState == CmsPublishEngineState.ENGINE_STOPPED) || (m_engineState == CmsPublishEngineState.ENGINE_STARTED)) { OpenCms.getLoginManager().checkLoginAllowed(); return true; } else { return false; } } catch (CmsAuthentificationException e) { return false; } } }
/** * Returns the pc type of the current request.<p> * * @param request the request * * @return the pc type */ private static String getPcType(HttpServletRequest request) { String pcType = null; if (!OpenCms.getLoginManager().isEnableSecurity()) { // if security option is disabled, just set PC type to "private" to get common login dialog pcType = PCTYPE_PRIVATE; } else { // security option is enabled, try to get PC type from request parameter pcType = CmsRequestUtil.getNotEmptyParameter(request, PARAM_PCTYPE); if (pcType == null) { Cookie pcTypeCookie = getCookie(request, COOKIE_PCTYPE); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(pcTypeCookie.getValue()) && !"null".equals(pcTypeCookie.getValue())) { pcType = pcTypeCookie.getValue(); } } } return pcType; }
CmsLoginMessage loginMessage = OpenCms.getLoginManager().getLoginMessage(); if ((loginMessage != null) && (loginMessage.isActive())) { String msg;
/** * Commits the edited login message to the login manager.<p> */ @Override public void actionCommit() { List<Throwable> errors = new ArrayList<Throwable>(); try { // set the edited message OpenCms.getLoginManager().setLoginMessage(getCms(), m_loginMessage); // update the system configuration OpenCms.writeConfiguration(CmsSystemConfiguration.class); // clear the message object setDialogObject(null); } catch (Throwable t) { errors.add(t); } // set the list of errors to display when saving failed setCommitErrors(errors); }
CmsLoginMessage loginMessage = OpenCms.getLoginManager().getLoginMessage(); if ((loginMessage != null) && (loginMessage.isActive())) { String msg;
/** * Initializes the login message object for this dialog.<p> */ protected void initLoginMessageObject() { Object o = getDialogObject(); if ((o == null) || !(o instanceof CmsLoginMessage)) { o = OpenCms.getLoginManager().getLoginMessage(); } if (o != null) { m_loginMessage = (CmsLoginMessage)((CmsLoginMessage)o).clone(); } else { m_loginMessage = new CmsLoginMessage(); } }
/** * Unlocks the user.<p> * * @throws Exception if something goes wrong */ public void actionUnlockUser() throws Exception { CmsUUID userId = new CmsUUID(m_paramUserId); CmsObject cms = getCms(); CmsUser user = cms.readUser(userId); OpenCms.getLoginManager().unlockUser(getCms(), user); actionCloseDialog(); }
for (CmsUser user : users) { try { if (OpenCms.getLoginManager().canLockBecauseOfInactivity(cms, user)) { if (OpenCms.getLoginManager().checkInactive(user)) { user = cms.readUser(user.getId()); if (user.getAdditionalInfo().get(CmsLoginController.KEY_ACCOUNT_LOCKED) == null) {
/** * Log a user in to the the CmsSell.<p> * * @param username the name of the user to log in * @param password the password of the user */ public void login(String username, String password) { username = OpenCms.getImportExportManager().translateUser(username); try { m_cms.loginUser(username, password); // reset the settings, this will switch the startup site root etc. m_shell.initSettings(); System.out.println(getMessages().key(Messages.GUI_SHELL_LOGIN_1, whoami().getName())); // output the login message if required CmsLoginMessage message = OpenCms.getLoginManager().getLoginMessage(); if ((message != null) && (message.isActive())) { System.out.println(message.getMessage()); } } catch (Exception exc) { System.out.println(getMessages().key(Messages.GUI_SHELL_LOGIN_FAILED_0)); } }
/** * Log a user in to the the CmsSell.<p> * * @param username the name of the user to log in * @param password the password of the user */ public void login(String username, String password) { username = OpenCms.getImportExportManager().translateUser(username); try { m_cms.loginUser(username, password); // reset the settings, this will switch the startup site root etc. m_shell.initSettings(); m_shell.getOut().println(getMessages().key(Messages.GUI_SHELL_LOGIN_1, whoami().getName())); // output the login message if required CmsLoginMessage message = OpenCms.getLoginManager().getLoginMessage(); if ((message != null) && (message.isActive())) { m_shell.getOut().println(message.getMessage()); } } catch (Exception exc) { m_shell.getOut().println(getMessages().key(Messages.GUI_SHELL_LOGIN_FAILED_0)); } }
if (OpenCms.getLoginManager().isEnableSecurity() && CmsStringUtil.isNotEmpty(pcType)) { Cookie pcTypeCookie = getCookie(request, COOKIE_PCTYPE); pcTypeCookie.setValue(pcType); ouFqnCookie.setValue(oufqn); setCookie(ouFqnCookie, false, request, response); } else if (OpenCms.getLoginManager().isEnableSecurity() && PCTYPE_PUBLIC.equals(pcType)) {
long expiration = OpenCms.getLoginManager().getTokenLifetime() + now; String expirationStr = CmsVfsService.formatDateTime(cms, expiration); String token = CmsTokenValidator.createToken(cms, foundUser, now);
if (OpenCms.getLoginManager().isEnableSecurity() && CmsStringUtil.isNotEmpty(pcType)) { Cookie pcTypeCookie = getCookie(request, COOKIE_PCTYPE); pcTypeCookie.setValue(pcType); ouFqnCookie.setValue(oufqn); setCookie(ouFqnCookie, false, request, response); } else if (OpenCms.getLoginManager().isEnableSecurity() && PCTYPE_PUBLIC.equals(pcType)) {
if (dbc.currentUser().isGuestUser()) { OpenCms.getLoginManager().addInvalidLogin(userName, remoteAddress); OpenCms.getLoginManager().checkInvalidLogins(userName, remoteAddress); throw new CmsAuthentificationException(org.opencms.security.Messages.get().container( org.opencms.security.Messages.ERR_LOGIN_FAILED_2, OpenCms.getLoginManager().checkInvalidLogins(userName, remoteAddress); OpenCms.getLoginManager().removeInvalidLogins(userName, remoteAddress); CmsRole.ADMINISTRATOR.forOrgUnit(dbc.getRequestContext().getOuFqn()))) { OpenCms.getLoginManager().checkLoginAllowed();
A_CmsUI.getCmsObject(), authToken, OpenCms.getLoginManager().getTokenLifetime()); if (validationResult == null) { CmsUser user = validator.getUser();
CmsLoginMessage loginMessage = OpenCms.getLoginManager().getLoginMessage(); if ((loginMessage != null) && loginMessage.isActive()) { OpenCms.getSessionManager().updateSessionInfo(getCmsObject(), getRequest());
if (OpenCms.getLoginManager().getLoginMessage() != null) { endTime = OpenCms.getLoginManager().getLoginMessage().getTimeEnd();
if (OpenCms.getLoginManager().getLoginMessage() != null) { endTime = OpenCms.getLoginManager().getLoginMessage().getTimeEnd();