From b143d24ef6984c9f2e0ec3f21ea234e669d5d870 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Sep 2007 12:48:29 +0000 Subject: [PATCH] Updated post events. Replace placeholder specified by parameter first, then replace with $this->attributes. This allows us, to overload attributes. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7212 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 5f2a567b7..8e992dccc 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -541,6 +541,12 @@ class plugin } if ($command != ""){ + + /* Additional attributes */ + foreach ($add_attrs as $name => $value){ + $command= preg_replace("/%$name/", $value, $command); + } + /* Walk through attribute list */ foreach ($this->attributes as $attr){ if (!is_array($this->$attr)){ @@ -549,11 +555,6 @@ class plugin } $command= preg_replace("/%dn/", $this->dn, $command); - /* Additional attributes */ - foreach ($add_attrs as $name => $value){ - $command= preg_replace("/%$name/", $value, $command); - } - if (check_command($command)){ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute"); @@ -575,6 +576,12 @@ class plugin } if ($command != ""){ + + /* Additional attributes */ + foreach ($add_attrs as $name => $value){ + $command= preg_replace("/%$name/", $value, $command); + } + /* Walk through attribute list */ foreach ($this->attributes as $attr){ if (!is_array($this->$attr)){ @@ -583,11 +590,6 @@ class plugin } $command= preg_replace("/%dn/", $this->dn, $command); - /* Additional attributes */ - foreach ($add_attrs as $name => $value){ - $command= preg_replace("/%$name/", $value, $command); - } - if (check_command($command)){ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute"); @@ -609,6 +611,12 @@ class plugin } if ($command != ""){ + + /* Additional attributes */ + foreach ($add_attrs as $name => $value){ + $command= preg_replace("/%$name/", $value, $command); + } + /* Walk through attribute list */ foreach ($this->attributes as $attr){ if (!is_array($this->$attr)){ -- 2.30.2