Code

Fixed expiration calculation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Jul 2010 05:40:47 +0000 (05:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Jul 2010 05:40:47 +0000 (05:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18934 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index 83ecd4b6ef7976758a78e05eaaf1f9ba22aedf31..5052f921d3eef044bd072221a27141b6ad81e37d 100644 (file)
@@ -683,6 +683,7 @@ function ldap_expired_account($config, $userdn, $uid)
     $attrs= $ldap->fetch();
     $current= floor(date("U") /60 /60 /24);
 
+
     // Fetch required attributes 
     foreach(array('shadowExpire','shadowLastChange','shadowMax','shadowMin',
                 'shadowInactive','shadowWarning') as $attr){
@@ -697,10 +698,10 @@ function ldap_expired_account($config, $userdn, $uid)
     //  the account expiration by the amount of days specified in (shadowInactive).
     if($shadowExpire != null && $shadowExpire >= $current){
 
-        // The account seems to be inactive, but we've to check 'shadowInactive' additionally.
+        // The account seems to be expired, but we've to check 'shadowInactive' additionally.
         // ShadowInactive specifies an amount of days we've to reprieve the user.
         // It some kind of x days' grace.
-        if($shadowExpire == null || $shadowExpire + $shadowExpire >= $current){
+        if($shadowInactive == null || $current > $shadowExpire + $shadowInactive){
 
             // Finally we've detect that the account is deactivated. 
             return(POSIX_ACCOUNT_EXPIRED);