Code

* Fixed current main base problem
[gosa.git] / plugins / personal / password / main.inc
index 76704c1e5ba94e45f1533dfbdd6ec6ca39667eb7..df07d11623bc9e282028dcf0dd2f26f28a0751be 100644 (file)
@@ -100,7 +100,18 @@ if (!$remove_lock){
   }
 
   if ($display == ""){
-    $display= $smarty->fetch(get_template_path("password.tpl", TRUE));
+    if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) &&
+      !preg_match('/true/i', $config->data['MAIN']['ACCOUNT_EXPIRATION'])){
+      $display= $smarty->fetch(get_template_path("password.tpl", TRUE));
+    }else{
+      $expired= ldap_expired_account($config, $ui->dn, $ui->username);
+      
+      if($expired == 4){
+        $display= $smarty->fetch(get_template_path("nochange.tpl", TRUE));
+      }else{
+        $display= $smarty->fetch(get_template_path("password.tpl", TRUE));
+      }
+    }
   }
 }