Code

Updated password change
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Sep 2010 08:52:59 +0000 (08:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Sep 2010 08:52:59 +0000 (08:52 +0000)
-Fixed event parameter list

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19579 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index de42b7ff82324d4460433e40ea7990a8544b114d..4d51156402f03f49453c3b5dfd7569aebed9ba7c 100644 (file)
@@ -3072,9 +3072,18 @@ function change_password ($dn, $password, $mode=FALSE, $hash= "", $old_password
         $attrs['userPassword']= $newpass;
 
         // Prepare prevent hook call
-        $attrsEvent = $attrs;
+        $attrsEvent = array();
+        foreach($initialAttrs as $name => $value){
+            if(!is_numeric($name))
+                $attrsEvent[$name] = escapeshellarg($value[0]);
+        }
+        $attrsEvent['dn'] = escapeshellarg($initialAttrs['dn']);
+        foreach($attrs as $name => $value){
+            $attrsEvent[$name] = escapeshellarg($value);
+        }
         $attrsEvent['current_password'] = escapeshellarg($old_password);
         $attrsEvent['new_password'] = escapeshellarg($password);
+
         $passwordPlugin = new password($config,$dn);
         plugin::callHook($passwordPlugin, 'PREMODIFY', $attrsEvent, $output,$retCode,$error, $directlyPrintError = FALSE);
         if($retCode === 0 && count($output)){