Code

Implemented php bug submitting
[gosa.git] / include / class_password-methods.inc
index 97571da7900f3e6d51f3190319cc0ba9508d6e64..b3c07653d868f7487592a86a72c7b48c412dfab7 100644 (file)
@@ -22,6 +22,7 @@
 class passwordMethod
 {
   var $config = false;
+  var $attrs= array();
 
   // Konstructor
   function passwordMethod($config)
@@ -102,7 +103,7 @@ function change_password ($dn, $password, $mode=0, $hash= "")
 
   // read current password entry for $dn, to detect the encryption Method
   $ldap       = $config->get_ldap_link();
-  $ldap->cat ($dn, array("shadowLastChange", "userPassword"));
+  $ldap->cat ($dn, array("shadowLastChange", "userPassword", "uid"));
   $attrs      = $ldap->fetch ();
 
   // Set encryption type to clear if required 
@@ -124,6 +125,7 @@ function change_password ($dn, $password, $mode=0, $hash= "")
 
     // Crypt with the detected Method
     $test = new  $available[$hash]($config);
+    $test->attrs= $attrs;
     $newpass =  $test->generate_hash($password);
 
   } else {
@@ -157,9 +159,9 @@ function change_password ($dn, $password, $mode=0, $hash= "")
   $attrs['userPassword']= array();
   $attrs['userPassword']= $newpass;
 
-
   $ldap->modify($attrs);
-
+  
+  new log("modify","users/passwordMethod",$dn,array_keys($attrs),$ldap->get_error());
 
   if ($ldap->error != 'Success') {
     print_red(sprintf(_("Setting the password failed. LDAP server says '%s'."),