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

This commit is contained in:
Elaine Tan 2012-10-01 17:56:05 +08:00
parent b65f9deeb9
commit b875bd411b
1 changed files with 9 additions and 3 deletions

View File

@ -1464,13 +1464,13 @@ public class Login
} }
else else
{ {
boolean foundLockedAccount = false;
for (MUser user : users) for (MUser user : users)
{ {
if (user.isLocked()) if (user.isLocked())
{ {
// User account ({0}) is locked, please contact the system administrator foundLockedAccount = true;
loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user}); continue;
break;
} }
int count = user.getFailedLoginCount() + 1; int count = user.getFailedLoginCount() + 1;
@ -1500,6 +1500,12 @@ public class Login
if (!user.save()) if (!user.save())
log.severe("Failed to update user record with increase failed login count"); log.severe("Failed to update user record with increase failed login count");
} }
if (loginErrMsg == null && foundLockedAccount)
{
// User account ({0}) is locked, please contact the system administrator
loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user});
}
} }
return retValue; return retValue;
} }