IDEMPIERE-373 Implement User Locking - fix locking error message when involving multi-clients user

This commit is contained in:
Elaine Tan 2012-10-03 12:33:03 +08:00
parent bf79e2ad22
commit 5b92e3a2d7
1 changed files with 10 additions and 1 deletions

View File

@ -1372,6 +1372,7 @@ public class Login
} }
} }
boolean validButLocked = false;
for (MUser user : users) { for (MUser user : users) {
if (clientsValidated.contains(user.getAD_Client_ID())) { if (clientsValidated.contains(user.getAD_Client_ID())) {
log.severe("Two users with password with the same name/email combination on same tenant: " + app_user); log.severe("Two users with password with the same name/email combination on same tenant: " + app_user);
@ -1387,7 +1388,10 @@ public class Login
} }
if (valid ) { if (valid ) {
if (user.isLocked()) if (user.isLocked())
{
validButLocked = true;
continue; continue;
}
if (user.isExpired()) if (user.isExpired())
isPasswordExpired = true; isPasswordExpired = true;
@ -1462,7 +1466,12 @@ public class Login
log.severe("Failed to update user record with date last login"); log.severe("Failed to update user record with date last login");
} }
} }
else else if (validButLocked)
{
// User account ({0}) is locked, please contact the system administrator
loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user});
}
else
{ {
boolean foundLockedAccount = false; boolean foundLockedAccount = false;
for (MUser user : users) for (MUser user : users)