From 72861b16a04b3c5e68def2117dede4f6ec17a5b0 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 6 Jul 2010 05:40:47 +0000 Subject: [PATCH] Fixed expiration calculation git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18934 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 83ecd4b6e..5052f921d 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -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); -- 2.30.2