Code

Added password update if samba passwords are missing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Sep 2007 09:43:41 +0000 (09:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Sep 2007 09:43:41 +0000 (09:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7250 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/samba/class_sambaAccount.inc

index 862d631088879d08680b9df347e88276ad1ce929..5375aeeeb6dd41a2783d2a3591034503d459ba43 100644 (file)
@@ -1035,9 +1035,22 @@ class sambaAccount extends plugin
     } else {
       $this->handle_post_events("add", array("uid" => $this->uid));
     }
+  }
+
 
+  /* Force password set, if this account doesn't have any samba passwords  */
+  function password_change_needed()
+  {
+    $ldap = $this->config->get_ldap_link();
+    $ldap->cat($this->dn,array("sambaLMPassword","sambaNTPassword"));
+    $attrs = $ldap->fetch();
+    if(!isset($attrs['sambaLMPassword']) || !isset($attrs['sambaNTPassword'])){
+      return(TRUE);
+    }
+    return(FALSE);
   }
 
+
   function adapt_from_template($dn)
   {
     plugin::adapt_from_template($dn);