portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1689716 - /portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/UserPasswordCredentialPolicyManagerImpl.java
Date Tue, 07 Jul 2015 17:32:32 GMT
Author: taylor
Date: Tue Jul  7 17:32:32 2015
New Revision: 1689716

URL: http://svn.apache.org/r1689716
Log:
JS2-1330: fixing bug in Password Credential Policy. 

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/UserPasswordCredentialPolicyManagerImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/UserPasswordCredentialPolicyManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/UserPasswordCredentialPolicyManagerImpl.java?rev=1689716&r1=1689715&r2=1689716&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/UserPasswordCredentialPolicyManagerImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/UserPasswordCredentialPolicyManagerImpl.java
Tue Jul  7 17:32:32 2015
@@ -106,6 +106,7 @@ public class UserPasswordCredentialPolic
             }
         }
         boolean update = false;
+        boolean failuresUpdated = false;
 
         for (PasswordCredentialInterceptor pci : interceptors)
         {
@@ -113,6 +114,9 @@ public class UserPasswordCredentialPolic
             {
                 update = true;
             }
+            if (pci instanceof MaxPasswordAuthenticationFailuresInterceptor) {
+                failuresUpdated = true;
+            }
         }
         if (update && (!credential.isEnabled() || credential.isExpired()))
         {
@@ -131,6 +135,12 @@ public class UserPasswordCredentialPolic
             credential.setLastAuthenticationDate(new Timestamp(new Date().getTime()));
             update = true;
         }
+        else
+        {
+            if (!failuresUpdated) {
+                credential.setAuthenticationFailures(credential.getAuthenticationFailures()
+ 1);
+            }
+        }
         return update;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message