Code

Fixed warnings with not set $_SERVER values in accept_get_text
[gosa.git] / include / class_plugin.inc
index f9a5b3a7878a94980514534ced443d0f9b2dd0a0..8e992dccc33c03b894848d7fe53767a16b168040 100644 (file)
@@ -383,6 +383,11 @@ class plugin
         }
       }
     }
+
+    /* Update saved attributes and ensure that next cleanups will be successful too */
+    foreach($this->attrs as $name => $value){
+      $this->saved_attributes[$name] = $value;
+    }
   }
 
   /* Check formular input */
@@ -536,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)){
@@ -544,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");
@@ -570,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)){
@@ -578,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");
@@ -604,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)){