index cfa7b8aed8fdd830d42ab380c14e8bbac1d9dd91..6d8dc0e3abd9b94c47b336c1e243de1f60064bab 100644 (file)
class passwordMethod
{
var $config = false;
+ var $attrs= array();
// Konstructor
function passwordMethod($config)
// this function returns all loaded classes for password encryption
- static function get_available_methods()
+ function get_available_methods()
{
$ret =false;
$all = get_declared_classes();
$newpass= "";
// Get all available encryption Methods
- $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
// Crypt with the detected Method
$test = new $available[$hash]($config);
+ $test->attrs= $attrs;
$newpass = $test->generate_hash($password);
} else {
$hash= current($ar);
if ($hash == "")
{
- print_red (_("Setting for SMBHASH in gosa.conf is incorrect! Can't change Samba password."));
+ print_red (sprintf(_("Setting for SMBHASH in %s is incorrect! Can't change Samba password."),CONFIG_FILE));
}
else
{