]> git.tokkee.org Git - gosa.git/commitdiff

Code

unified post event handling!
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 08:38:00 +0000 (08:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 08:38:00 +0000 (08:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15873 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/services/class_goService.inc

index 1134f1cd7fc3927a1297dda5570c10732b632f3e..a7ff07b5b7967fb59ff7537f6ca8c95eea49100e 100644 (file)
@@ -200,43 +200,9 @@ class goService extends plugin{
   }  
 
   
-  function action_hook($add_attrs= array())
+  function action_hook($addAttrs= array())
   {
-    /* Find postcreate entries for this class */
-    $command= $this->config->search(get_class($this), "SERVICEACTIONHOOK",array('menu','tabs'));
-    if ($command != ""){
-
-      /* Walk through attribute list */
-      foreach ($this->attributes as $attr){
-        if (!is_array($this->$attr)){
-          $command= preg_replace("/%$attr/", $this->$attr, $command);
-        }
-      }
-      $command= preg_replace("/%dn/", $this->dn, $command);
-
-      /* Additional attributes */
-      foreach ($add_attrs as $name => $value){
-        $command= preg_replace("/%$name/", $value, $command);
-      }
-
-      /* If there are still some %.. in our command, try to fill these with some other class vars */
-      if(preg_match("/%/",$command)){
-        $attrs = get_object_vars($this);
-        foreach($attrs as $name => $value){
-          if(!is_string($value)) continue;
-          $command= preg_replace("/%$name/", $value, $command);
-        }
-      }
-
-      if (check_command($command)){
-        @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
-            $command, "Execute");
-
-        exec($command);
-      } else {
-        msg_dialog::display(_("Configuration error"), msgPool::cmdnotfound("SERVICEACTIONHOOK", get_class($this)), ERROR_DIALOG);
-      }
-    }
+    $this->callHook('SERVICEACTIONHOOK', $addAttrs);
   }