ACE-3216 - server.maxusers count does not work correctly - off by one

- Fix fun off-by-one error meaning that 1 users = 0 users hoho!
ACE-3296 - SysAdmin bean should validate values for server.maxusers - or it is possible to accidently lock out the admin user!
   - Fix to ensure that although -1 means "infinite users allowed", a value of -2 or less does not mean "no users allowed" double-hoho!

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@89105 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2014-10-24 11:43:59 +00:00
parent 3740ac93d1
commit 613db46e5f

View File

@@ -53,7 +53,7 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
Integer maxUsers = (Integer) sysAdminParams.getMaxUsers(); Integer maxUsers = (Integer) sysAdminParams.getMaxUsers();
if ((maxUsers != null) && (maxUsers != -1) && (getUsersWithTickets(true).size() >= maxUsers)) if ((maxUsers != null) && (maxUsers > -1) && (getUsersWithTickets(true).size() > maxUsers))
{ {
throw new AuthenticationMaxUsersException("Max users exceeded: " + maxUsers); throw new AuthenticationMaxUsersException("Max users exceeded: " + maxUsers);
} }