Code

Added ability to return command results in plugin::callHook
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jul 2010 14:08:54 +0000 (14:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jul 2010 14:08:54 +0000 (14:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18906 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/password-methods/class_password-methods.inc

index 808d5950e9198a1577cae822d0ffb73bcb7667c1..b933300e1fc82afe60bd24faf204069a69d29408 100644 (file)
@@ -336,8 +336,15 @@ class passwordMethod
     {
         if($config->configRegistry->propertyExists('core', 'passwordProposalHook')){
             $value = $config->configRegistry->getPropertyValue('core', 'passwordProposalHook');
-            echo $value;
+            $core = new core($config);
+
+            // No execute the hook and fetch the results.
+            plugin::callHook($core, 'passwordProposalHook', $addAttrs= array(), $ret);
+            if(count($ret) && !empty($ret[0])){
+                return($ret[0]);
+            }
         }
+        return('');
     }