From: hickert Date: Mon, 26 Mar 2007 08:21:47 +0000 (+0000) Subject: Added acls for sieve trunk X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=26f2aae43fd4195da3a8c9aed4affa7355d75097;p=gosa.git Added acls for sieve trunk git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5880 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index d5701e3bb..da9a10978 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -273,16 +273,15 @@ class sieveManagement extends plugin } /* remove script requested */ - if(preg_match("/^delscript_/",$name) && $once && !$this->current_handler){ + if($this->parent->acl_is_writeable("sieveManagement") && preg_match("/^delscript_/",$name) && $once && !$this->current_handler){ $script = preg_replace("/^delscript_/","",$name); $script = preg_replace("/_(x|y)/","",$script); $once = FALSE; - $this->script_to_delete = $script; } /* Activate script */ - if(preg_match("/^active_script_/",$name) && $once && !$this->current_handler){ + if($this->parent->acl_is_writeable("sieveManagement") && preg_match("/^active_script_/",$name) && $once && !$this->current_handler){ $script = preg_replace("/^active_script_/","",$name); $script = preg_replace("/_(x|y)/","",$script); $once = FALSE; @@ -327,7 +326,7 @@ class sieveManagement extends plugin } /* Remove confirmed */ - if(isset($_POST['delete_script_confirm'])){ + if($this->parent->acl_is_writeable("sieveManagement") && isset($_POST['delete_script_confirm'])){ $script = $this->scripts[$this->script_to_delete]; @@ -376,7 +375,7 @@ class sieveManagement extends plugin } /* Save currently edited sieve script. */ - if(isset($_POST['save_sieve_changes'])){ + if($this->parent->acl_is_writeable("sieveManagement") && isset($_POST['save_sieve_changes'])){ $chk = $this->current_handler->check(); if(!count($chk)){ @@ -642,15 +641,19 @@ class sieveManagement extends plugin "attach" => "style='width:30px;'"); } - if($active || $script['IS_NEW']){ - $field6 = array("string" => " ". - "". - ""); + if($this->parent->acl_is_writeable("sieveManagement")){ + $del = ""; }else{ - $field6 = array("string" => "". - "". - ""); + $del = " "; } + + if($active || $script['IS_NEW'] || !$this->parent->acl_is_writeable("sieveManagement")){ + $activate = " "; + }else{ + $activate = ""; + } + + $field6 = array("string" => $activate."".$del); $List ->AddEntry(array($field1,$field2,$field3,$field4,$field5,$field6)); } diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index da82a9423..ff796593e 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -238,7 +238,9 @@ class mailAccount extends plugin /* * Sieve Management */ - if(isset($_POST['sieveManagement']) && preg_match("/C/",$this->gosaMailDeliveryMode)) { + if(isset($_POST['sieveManagement']) + && preg_match("/C/",$this->gosaMailDeliveryMode) + && $this->acl_is_writeable("sieveManagement")) { $this->dialog = new sieveManagement($this->config,$this->dn,$this); } @@ -549,7 +551,10 @@ class mailAccount extends plugin $smarty->assign("mailACL", preg_replace("/w/","",$this->getacl("mail",$SkipWrite))); } - if (preg_match('/V/', $this->gosaMailDeliveryMode)){ + /* Disable/Enable range select, but do not disable them twice + * if they are already diabled by "use own sieve script" + */ + if (preg_match('/V/', $this->gosaMailDeliveryMode) || preg_match("/C/",$this->gosaMailDeliveryMode)){ $smarty->assign('rangeEnabled', ""); } else { $smarty->assign('rangeEnabled', "disabled"); @@ -1127,6 +1132,8 @@ class mailAccount extends plugin "gosaSpamSortLevel" => _("Spam level"), "gosaSpamMailbox" => _("Spam mail box"), + "sieveManagement" => _("Sieve manamgent"), + "gosaMailDeliveryModeR" => _("Reject due to mailsize"), // This is flag of gosaMailDeliveryMode "gosaMailMaxSize" => _("Mail max size"), diff --git a/plugins/personal/mail/generic.tpl b/plugins/personal/mail/generic.tpl index 51e424fa2..12bc8b175 100644 --- a/plugins/personal/mail/generic.tpl +++ b/plugins/personal/mail/generic.tpl @@ -109,8 +109,10 @@ - + +{render acl=$sieveManagementACL} +{/render}