From 9793db6d3d5d662e9f495ba6981cd10dc745de7c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 3 May 2007 13:18:29 +0000 Subject: [PATCH] Fixed acl handling for sieve Management git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6254 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_sieveManagement.inc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index 6ac3c6ee5..b8edabbc1 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -54,12 +54,18 @@ class sieveManagement extends plugin * import dialog opened. */ var $Import_Script = FALSE; + var $acl = ""; /* Initialize the class and load all sieve scripts * try to parse them and display errors */ function sieveManagement($config,$dn,$parent,$uattrib) { + /* Use mail Acls here */ + $ui = get_userinfo(); + $acl= get_permissions ($ui->dn, $ui->subtreeACL); + $this->acl= get_module_permission($acl, "mailAccount", $ui->dn); + /* Check given parameter */ if(!isset($parent->$uattrib)){ trigger_error("Sieve Management implementation error. Parameter 4 must be part of the given parent element."); @@ -280,7 +286,7 @@ class sieveManagement extends plugin } /* remove script requested */ - if(chkacl($this->parent->acl,"sieveManagement") == "" && preg_match("/^delscript_/",$name) && $once && !$this->current_handler){ + if(chkacl($this->acl,"sieveManagement") == "" && preg_match("/^delscript_/",$name) && $once && !$this->current_handler){ $script = preg_replace("/^delscript_/","",$name); $script = preg_replace("/_(x|y)/","",$script); $once = FALSE; @@ -288,7 +294,7 @@ class sieveManagement extends plugin } /* Activate script */ - if(chkacl($this->parent->acl,"sieveManagement") == "" && preg_match("/^active_script_/",$name) && $once && !$this->current_handler){ + if(chkacl($this->acl,"sieveManagement") == "" && preg_match("/^active_script_/",$name) && $once && !$this->current_handler){ $script = preg_replace("/^active_script_/","",$name); $script = preg_replace("/_(x|y)/","",$script); $once = FALSE; @@ -333,7 +339,7 @@ class sieveManagement extends plugin } /* Remove confirmed */ - if(chkacl($this->parent->acl,"sieveManagement") == "" && isset($_POST['delete_script_confirm'])){ + if(chkacl($this->acl,"sieveManagement") == "" && isset($_POST['delete_script_confirm'])){ $script = $this->scripts[$this->script_to_delete]; @@ -382,7 +388,7 @@ class sieveManagement extends plugin } /* Save currently edited sieve script. */ - if(chkacl($this->parent->acl,"sieveManagement") == "" && + if(chkacl($this->acl,"sieveManagement") == "" && isset($_POST['save_sieve_changes']) && is_object($this->current_handler)){ $chk = $this->current_handler->check(); @@ -646,14 +652,14 @@ class sieveManagement extends plugin $field3 = array("string" => $script['MSG']); $field4 = array("string" => _("Script length").": ".strlen($script['SCRIPT'])); - if(chkacl($this->parent->acl,"sieveManagement") == ""){ + if(chkacl($this->acl,"sieveManagement") == ""){ $del = ""; }else{ $del = " "; } - if($active || $script['IS_NEW'] || chkacl($this->parent->acl,"sieveManagement") != ""){ + if($active || $script['IS_NEW'] || chkacl($this->acl,"sieveManagement") != ""){ $activate = " "; }else{ $activate = "