Code

Added some more checks
[gosa.git] / plugins / admin / groups / class_groupAcl.inc
index 46c4a856b9c6c98921a10a83ee3ad5e6517d03a5..5ce1d53908dc7830f93de6b7cb4eaa9efbc02de1 100644 (file)
@@ -20,9 +20,10 @@ class acl extends plugin
   var $current_acl= "";
   var $selfflag= FALSE;
 
+       var $gosaSubtreeACL;
 
   /* attribute list for save action */
-  var $attributes= array();
+  var $attributes= array("gosaSubtreeACL");
   var $objectclasses= array("gosaObject");
 
   function acl ($config, $dn= NULL)
@@ -49,6 +50,9 @@ class acl extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
        /* Do we represent a valid group? */
        if (!$this->is_account && $this->parent == NULL){
                $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
@@ -91,7 +95,9 @@ class acl extends plugin
 
        $ldap= $this->config->get_ldap_link();
        $ldap->cd($this->dn);
-       $ldap->modify($this->attrs);
+       $this->cleanup();
+$ldap->modify ($this->attrs); 
+
        show_ldap_error($ldap->get_error());
   }
 
@@ -109,7 +115,7 @@ class acl extends plugin
        if ($this->object == "all"){
                $this->current_acl= preg_replace ( "/[,]?all[,]?/", "", $this->current_acl);
        }
-       $this->current_acl= preg_replace ( "/[,]?$this->object#[^,]*[,]?/", "", $this->current_acl);
+       $this->current_acl= preg_replace ( "/[^a-z0-9A-Z]$this->object#[^,]*[,]?/", "", $this->current_acl);
 
        /* assemble new attributes */
        $attrs= "";
@@ -186,7 +192,9 @@ class acl extends plugin
 
        /* Modify class */
        $ldap->cd($this->dn);
-       $ldap->modify($this->attrs);
+       $this->cleanup();
+$ldap->modify ($this->attrs); 
+
        show_ldap_error($ldap->get_error());
   }