Code

Updated password expiry handling
[gosa.git] / gosa-core / include / functions.inc
index 5052f921d3eef044bd072221a27141b6ad81e37d..805acec79ea562593927625ec8e82db762fa72cd 100644 (file)
@@ -677,13 +677,16 @@ function ldap_login_user ($username, $password)
  */
 function ldap_expired_account($config, $userdn, $uid)
 {
+
+    // Skip this for the admin account, we do not want to lock him out.
+    if($uid == 'admin') return(0);
+
     $ldap= $config->get_ldap_link();
     $ldap->cd($config->current['BASE']);
     $ldap->cat($userdn);
     $attrs= $ldap->fetch();
     $current= floor(date("U") /60 /60 /24);
 
-
     // Fetch required attributes 
     foreach(array('shadowExpire','shadowLastChange','shadowMax','shadowMin',
                 'shadowInactive','shadowWarning') as $attr){
@@ -759,7 +762,7 @@ function ldap_expired_account($config, $userdn, $uid)
         }
     }    
 
-    return(NULL);
+    return(0);
 }