Code

Fixed Problem with saving new ACL for a tagged department.
[gosa.git] / gosa-core / include / class_plugin.inc
index 8ae807992ea217da787fb42990ede73407aa53c4..57fc5107d0b1493be47f47d40687ade74c39fdf9 100644 (file)
@@ -215,13 +215,18 @@ class plugin
           unset($this->saved_attributes[$index]);
           continue;
         }
-        if (isset($this->saved_attributes[$index][0]) && $this->saved_attributes[$index]["count"] == 1){
-          $tmp= $this->saved_attributes[$index][0];
-          unset($this->saved_attributes[$index]);
-          $this->saved_attributes[$index]= $tmp;
-          continue;
-        }
 
+        if (isset($this->saved_attributes[$index][0])){
+          if(!isset($this->saved_attributes[$index]["count"])){
+            $this->saved_attributes[$index]["count"] = count($this->saved_attributes[$index]);
+          }
+          if($this->saved_attributes[$index]["count"] == 1){
+            $tmp= $this->saved_attributes[$index][0];
+            unset($this->saved_attributes[$index]);
+            $this->saved_attributes[$index]= $tmp;
+            continue;
+          }
+        }
         unset($this->saved_attributes["$index"]["count"]);
       }
       if(isset($this->attrs['gosaUnitTag'])){
@@ -634,7 +639,7 @@ class plugin
 
         exec($command);
       } else {
-        $message[]= msgPool::cmdnotfound("POSTCREATE", get_class($this));
+        $message= msgPool::cmdnotfound("POSTCREATE", get_class($this));
         msg_dialog::display(_("Error"), $message, ERROR_DIALOG);
       }
     }
@@ -671,7 +676,7 @@ class plugin
         @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,$command, "Execute");
         exec($command);
       } else {
-        $message[]= msgPool::cmdnotfound("POSTMODIFY", get_class($this));
+        $message= msgPool::cmdnotfound("POSTMODIFY", get_class($this));
         msg_dialog::display(_("Error"), $message, ERROR_DIALOG);
       }
     }
@@ -709,7 +714,7 @@ class plugin
 
         exec($command);
       } else {
-        $message[]= msgPool::cmdnotfound("POSTREMOVE", get_class($this));
+        $message= msgPool::cmdnotfound("POSTREMOVE", get_class($this));
         msg_dialog::display(_("Error"), $message, ERROR_DIALOG);
       }
     }
@@ -1011,7 +1016,7 @@ class plugin
         foreach ($this->config->adepartments as $key => $ntag){
 
           /* This one is bigger than our dn, its not relevant... */
-          if ($len <= strlen($key)){
+          if ($len < strlen($key)){
             continue;
           }