continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r439922 - /maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
Date Mon, 04 Sep 2006 04:21:01 GMT
Author: carlos
Date: Sun Sep  3 21:20:54 2006
New Revision: 439922

URL: http://svn.apache.org/viewvc?view=rev&rev=439922
Log:
Reformat

Modified:
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java?view=diff&rev=439922&r1=439921&r2=439922
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
Sun Sep  3 21:20:54 2006
@@ -43,8 +43,8 @@
     implements UserDetailsService
 {
     private static final long MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
-   
-   /**
+
+    /**
      * @plexus.requirement
      */
     private UserManager userManager;
@@ -63,7 +63,7 @@
     {
         ContinuumUser user;
 
-        user = ( ContinuumUser ) userManager.getUser( username );
+        user = (ContinuumUser) userManager.getUser( username );
 
         if ( user == null )
         {
@@ -95,12 +95,14 @@
         String password = user.getEncodedPassword();
         boolean enabled = true;
         boolean accountNonExpired = true;
-        
-        if( user.getLastPasswordChange() != null && daysBeforeExpiration > 0 )
+
+        if ( user.getLastPasswordChange() != null && daysBeforeExpiration > 0
)
         {
-           accountNonExpired = user.getLastPasswordChange().getTime() + daysBeforeExpiration
* MILLISECONDS_PER_DAY > new Date().getTime();
+            long lastPasswordChange = user.getLastPasswordChange().getTime();
+            long currentTime = new Date().getTime();
+            accountNonExpired = lastPasswordChange + daysBeforeExpiration * MILLISECONDS_PER_DAY
> currentTime;
         }
-        
+
         boolean credentialsNonExpired = true;
         boolean accountNonLocked = true;
 
@@ -109,12 +111,12 @@
 
         return userDetails;
     }
-    
+
     protected void setDaysBeforeExpiration( int daysBeforeExpiration )
     {
-       this.daysBeforeExpiration = daysBeforeExpiration;
+        this.daysBeforeExpiration = daysBeforeExpiration;
     }
-    
+
     /**
      * TODO: convert Acegi user into Continuum user?
      */



Mime
View raw message