From: cajus Date: Thu, 16 Nov 2006 05:30:24 +0000 (+0000) Subject: Fixed kerberos password handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=38e112e6bdb6281beace80e8e29f2a3d2b0ca490;p=gosa.git Fixed kerberos password handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5134 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_password-methods-kerberos.inc b/include/class_password-methods-kerberos.inc index 1e8ba722d..e66ebbba9 100644 --- a/include/class_password-methods-kerberos.inc +++ b/include/class_password-methods-kerberos.inc @@ -23,6 +23,7 @@ class passwordMethodkerberos extends passwordMethod function passwordMethodkerberos($config) { + $this->config=$config; } function is_available() @@ -52,7 +53,7 @@ class passwordMethodkerberos extends passwordMethod print_red (_("Kerberos database communication failed!")); } - $ret= kadm5_chpass_principal($handle, $attrs['uid'][0]."@".$cfg['REALM'],$password); + $ret= kadm5_chpass_principal($handle, $this->attrs['uid'][0]."@".$cfg['REALM'],$password); if ($ret === FALSE) { @@ -61,7 +62,7 @@ class passwordMethodkerberos extends passwordMethod kadm5_destroy($handle); - $newpass= "{kerberos}".$attrs['uid'][0]."@".$cfg['REALM']; + $newpass= "{kerberos}".$this->attrs['uid'][0]."@".$cfg['REALM']; return $newpass; } diff --git a/include/class_password-methods.inc b/include/class_password-methods.inc index 97571da79..2755134f1 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) @@ -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 {