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
{
boolean foundLockedAccount = false;
for (MUser user : users)
{
if (user.isLocked())
{
// User account ({0}) is locked, please contact the system administrator
loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user});
break;
foundLockedAccount = true;
continue;
}
int count = user.getFailedLoginCount() + 1;
@ -1500,6 +1500,12 @@ public class Login
if (!user.save())
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;
}