From 8aa40152978f49efff4f9b387693df2a01628f8c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 3 Mar 2010 08:38:00 +0000 Subject: [PATCH] unified post event handling! git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15873 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/services/class_goService.inc | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/services/class_goService.inc b/gosa-plugins/systems/admin/systems/services/class_goService.inc index 1134f1cd7..a7ff07b5b 100644 --- a/gosa-plugins/systems/admin/systems/services/class_goService.inc +++ b/gosa-plugins/systems/admin/systems/services/class_goService.inc @@ -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); } -- 2.30.2