Code

Updated expiration detection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Jul 2010 14:01:20 +0000 (14:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Jul 2010 14:01:20 +0000 (14:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18947 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index 805acec79ea562593927625ec8e82db762fa72cd..531f7942be3a787e90cb1dda20457f85d0a5b96f 100644 (file)
@@ -732,6 +732,15 @@ function ldap_expired_account($config, $userdn, $uid)
         }
     }
 
+    // -- I guess this is the correct detection, isn't it?
+    if($shadowLastChange != null && $shadowWarning != null && $shadowMax != null){
+        $daysRemaining = ($shadowLastChange + $shadowMax) - $current ;
+        if($daysRemaining > 0 && $daysRemaining <= $shadowWarning){
+                return(POSIX_WARN_ABOUT_EXPIRATION);
+        }
+    }
+
+
 
     // Check if we've to force the user to change his password.
     // --------------------------------------------------------