Commit ac9e512e authored by Matija Obreza's avatar Matija Obreza
Browse files

Lockout i18n and cosmetics

parent b4ac0649
......@@ -91,7 +91,8 @@ public class AccountLockoutManager {
stats.uuid = user.getUuid();
loginAttempts.put(userName, stats);
} else {
_log.info("No such user username=" + userName);
if (_log.isDebugEnabled())
_log.debug("No such user username=" + userName);
}
}
......@@ -101,7 +102,7 @@ public class AccountLockoutManager {
_log.info("Updated failed login statistics for username=" + userName + " " + stats);
if (stats.count >= lockAfterXFailures) {
_log.warn("Failed login attempts exceeded. Locking account for username=" + userName);
_log.warn("Too many failed login attempts. Locking account for username=" + userName);
userService.setAccountLockLocal(stats.uuid, true);
}
}
......@@ -115,7 +116,9 @@ public class AccountLockoutManager {
if (loginAttempts.size() == 0)
return;
_log.debug("Purging expired entries");
if (_log.isDebugEnabled())
_log.debug("Purging expired entries");
List<String> userNames = new ArrayList<String>(loginAttempts.keySet());
long now = new Date().getTime();
......@@ -133,7 +136,8 @@ public class AccountLockoutManager {
}
}
_log.info("Number of failed login attempts in memory: " + loginAttempts.size());
if (_log.isDebugEnabled())
_log.debug("Number of failed login attempts in memory: " + loginAttempts.size());
}
private class AttemptStatistics {
......
......@@ -204,7 +204,7 @@ public class UserServiceImpl implements UserService {
throw new SecurityException("Can't disable ADMINISTRATOR accounts");
user.setEnabled(enabled);
userPersistence.save(user);
LOG.warn("Disabled/enabled user account for user=" + user.getEmail() + " enabled=" + enabled);
LOG.warn("User account for user=" + user.getEmail() + " enabled=" + enabled);
}
/**
......
......@@ -94,6 +94,8 @@ user.create-new-account=Create an account
user.full-name=Full Name
user.email=E-mail Address
user.account-status=Account Status
user.account-disabled=Account disabled
user.account-locked-until=Account locked until
userprofile.page.title=User profile
userprofile.update.title=Update your profile
......
......@@ -18,21 +18,23 @@
<div class="form-horizontal">
<div class="form-group">
<label for="password" class="col-lg-2 control-label"><spring:message code="user.full-name" /></label>
<div class="col-lg-3">${user.name}</div>
<div class="col-lg-5">${user.name}</div>
</div>
<security:authorize access="hasRole('ADMINISTRATOR') || (isAuthenticated() && principal.user.id == #user.id)">
<div class="form-group">
<label for="password" class="col-lg-2 control-label"><spring:message code="user.email" /></label>
<div class="col-lg-3">${user.email}</div>
<div class="col-lg-5">${user.email}</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label"><spring:message code="user.account-status" /></label>
<div class="col-lg-3">
<div class="col-lg-5">
<c:if test="${user.systemAccount}">SYSTEM</c:if>
<c:if test="${not user.enabled}">DISABLED</c:if>
<c:if test="${user.accountLocked}">LOCKED</c:if>
<c:if test="${not user.enabled}"><spring:message code="user.account-disabled" /></c:if>
<c:if test="${user.accountLocked}"><spring:message code="user.account-locked-until" />
<fmt:formatDate value="${user.lockedUntil}" type="time" />
</c:if>
</div>
</div>
</security:authorize>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment