Code

Do not write samba hashes while there is no hook defined.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jul 2010 14:27:21 +0000 (14:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jul 2010 14:27:21 +0000 (14:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19043 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index d2340c80db327d90c47d760d9b34c410316994b9..7915adc15eb262eee104e87a90246be508bdc5eb 100644 (file)
@@ -3043,12 +3043,17 @@ function change_password ($dn, $password, $mode=0, $hash= "")
 
     // Not for groups
     if ($mode == 0){
-      // Create SMB Password
-      $attrs= generate_smb_nt_hash($password);
 
-      if ($shadow != 0){
-        $attrs['shadowLastChange']= $shadow;
-      }
+        $tmp = $config->get_cfg_value('core','sambaHashHook');
+        if(!empty($tmp)){
+
+            // Create SMB Password
+            $attrs= generate_smb_nt_hash($password);
+
+            if ($shadow != 0){
+                $attrs['shadowLastChange']= $shadow;
+            }
+        }
     }
 
     $attrs['userPassword']= array();