/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsUserDisabledException(container, cause); }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsUserDisabledException(container, cause); }
/** * Checks if the threshold for the invalid logins has been reached for the given user.<p> * * In case the configured threshold is reached, an Exception is thrown.<p> * * @param userName the name of the user * @param remoteAddress the remote address (IP) from which the login attempt was made * * @throws CmsAuthentificationException in case the threshold of invalid login attempts has been reached */ public void checkInvalidLogins(String userName, String remoteAddress) throws CmsAuthentificationException { if (m_maxBadAttempts < 0) { // invalid login storage is disabled return; } String key = createStorageKey(userName, remoteAddress); // look up the user in the storage CmsUserData userData = (CmsUserData)m_storage.get(key); if ((userData != null) && (userData.isDisabled())) { // threshold of invalid logins is reached throw new CmsUserDisabledException(Messages.get().container( Messages.ERR_LOGIN_FAILED_TEMP_DISABLED_4, new Object[] {userName, remoteAddress, userData.getReleaseDate(), userData.getInvalidLoginCount()})); } }
/** * Checks if the threshold for the invalid logins has been reached for the given user.<p> * * In case the configured threshold is reached, an Exception is thrown.<p> * * @param userName the name of the user * @param remoteAddress the remote address (IP) from which the login attempt was made * * @throws CmsAuthentificationException in case the threshold of invalid login attempts has been reached */ public void checkInvalidLogins(String userName, String remoteAddress) throws CmsAuthentificationException { if (m_maxBadAttempts < 0) { // invalid login storage is disabled return; } String key = createStorageKey(userName, remoteAddress); // look up the user in the storage CmsUserData userData = m_storage.get(key); if ((userData != null) && (userData.isDisabled())) { // threshold of invalid logins is reached throw new CmsUserDisabledException( Messages.get().container( Messages.ERR_LOGIN_FAILED_TEMP_DISABLED_4, new Object[] { userName, remoteAddress, userData.getReleaseDate(), userData.getInvalidLoginCount()})); } }