Code

Updated language detection code
[gosa.git] / include / class_password-methods.inc
index 97571da7900f3e6d51f3190319cc0ba9508d6e64..4ebc87bb701e94479e436bd18de96dbcdf49e581 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 
@@ -121,9 +122,9 @@ function change_password ($dn, $password, $mode=0, $hash= "")
       $hash= strtolower($matches[1]);
     }
 
-
     // Crypt with the detected Method
     $test = new  $available[$hash]($config);
+    $test->attrs= $attrs;
     $newpass =  $test->generate_hash($password);
 
   } else {
@@ -199,7 +200,7 @@ function generate_smb_nt_hash($password)
   $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 
   {