no need to try updating the user if userManagerImpl is read only

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1421158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-13 09:15:46 +00:00
parent e5950ce1ad
commit ad540803af
1 changed files with 10 additions and 2 deletions

View File

@ -140,7 +140,10 @@ public class ArchivaUserManagerAuthenticator
if ( user.getCountFailedLoginAttempts() > 0 )
{
user.setCountFailedLoginAttempts( 0 );
userManager.updateUser( user );
if ( !userManager.isReadOnly() )
{
userManager.updateUser( user );
}
}
return new AuthenticationResult( true, source.getPrincipal(), null );
@ -162,11 +165,16 @@ public class ArchivaUserManagerAuthenticator
try
{
securityPolicy.extensionExcessiveLoginAttempts( user );
}
finally
{
userManager.updateUser( user );
if ( !userManager.isReadOnly() )
{
userManager.updateUser( user );
}
}
//return new AuthenticationResult( false, source.getPrincipal(), null, authnResultExceptionsMap );