X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_password-methods.inc;h=b3c07653d868f7487592a86a72c7b48c412dfab7;hb=41fd4a4b7ce9abec36b49cc8fcc80758bbf1d30c;hp=7c00dccdeed159db862e2853bdf8c00a0e9bfa8d;hpb=3fd3b336261d6fc708e0558092e179cde8facdd4;p=gosa.git diff --git a/include/class_password-methods.inc b/include/class_password-methods.inc index 7c00dccde..b3c07653d 100644 --- a/include/class_password-methods.inc +++ b/include/class_password-methods.inc @@ -22,6 +22,7 @@ class passwordMethod { var $config = false; + var $attrs= array(); // Konstructor function passwordMethod($config) @@ -96,16 +97,13 @@ function change_password ($dn, $password, $mode=0, $hash= "") // Get all available encryption Methods - // STATIC : :( - // $available = passwordMethod::get_available_methods(); - // NON STATIC CALL :) $tmp = new passwordMethod($_SESSION['config']); $available = $tmp->get_available_methods(); // read current password entry for $dn, to detect the encryption Method $ldap = $config->get_ldap_link(); - $ldap->cat ($dn); + $ldap->cat ($dn, array("shadowLastChange", "userPassword", "uid")); $attrs = $ldap->fetch (); // Set encryption type to clear if required @@ -127,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 { @@ -160,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'."),