From: cajus Date: Mon, 15 Oct 2007 13:39:05 +0000 (+0000) Subject: Updated password methods X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=387a8ff163da84a9885feaa4fb936031c93eebf5;p=gosa.git Updated password methods git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7556 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_password-methods.inc b/include/class_password-methods.inc index 9ed414980..a23e55e07 100644 --- a/include/class_password-methods.inc +++ b/include/class_password-methods.inc @@ -88,10 +88,20 @@ class passwordMethod } + // Method to let password backends remove additional information besides + // the userPassword attribute function remove_from_parent() { } + + // Method to let passwords backends manage additional information + // besides the userAttribute entry + function set_password() + { + } + + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/include/functions.inc b/include/functions.inc index 23300bd08..2d5dd7b6d 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -2429,15 +2429,19 @@ function change_password ($dn, $password, $mode=0, $hash= "") } $test = new $available[$hash]($config); - $test->attrs= $attrs; $newpass = $test->generate_hash($password); } else { - // Crypt it by default + // User MD5 by default + $hash= "md5"; $test = new $available['md5']($config); $newpass = $test->generate_hash($password); } + /* Feed password backends with information */ + $test->dn= $dn; + $test->attrs= $attrs; + // Update shadow timestamp? if (isset($attrs["shadowLastChange"][0])){ $shadow= (int)(date("U") / 86400); @@ -2477,6 +2481,9 @@ function change_password ($dn, $password, $mode=0, $hash= "") $ldap->get_error())); } else { + /* Run backend method for change/create */ + $test->set_password($password); + /* Find postmodify entries for this class */ $command= $config->search("password", "POSTMODIFY",array('menu'));