summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 44c4386)
raw | patch | inline | side by side (parent: 44c4386)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Aug 2006 09:54:24 +0000 (09:54 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Aug 2006 09:54:24 +0000 (09:54 +0000) |
Not tested yet
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4541 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4541 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/groups/class_groupMail.inc | patch | blob | history |
index e79a7d71ff92502e31e0ffcbd99f6fccaceb1c25..302f582fbbbdc42dc2575d860aaf145f14d32a69 100644 (file)
$smarty->assign($name."ACL",$this->getacl($name));
}
-
-
if ($_SESSION['js']==FALSE){
$smarty->assign("javascript", "false");
} else {
}
/* Do we need to flip is_account state? */
- if (isset($_POST['modify_state'])){
- $this->is_account= !$this->is_account;
+ if(isset($_POST['modify_state'])){
+ if($this->is_account && $this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }elseif(!$this->is_account && $this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
}
+
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
}
/* Add ACL? */
- foreach ($this->indexed_user as $nr => $user){
- if (isset($_POST["add_$nr"])){
- $this->imapacl[""]= "l";
- }
- if (isset($_POST["del_$nr"])){
- unset ($this->imapacl[$user]);
+ if($this->acl_is_writeable("acl")){
+ foreach ($this->indexed_user as $nr => $user){
+ if (isset($_POST["add_$nr"])){
+ $this->imapacl[""]= "l";
+ }
+ if (isset($_POST["del_$nr"])){
+ unset ($this->imapacl[$user]);
+ }
}
}
/* Trigger forward add dialog? */
- if (isset($_POST['add_local_forwarder'])){
- $this->forward_dialog= TRUE;
- $this->dialog= TRUE;
+ if($this->acl_is_writeable("gosaMailForwardingAddress")){
+ if (isset($_POST['add_local_forwarder'])){
+ $this->forward_dialog= TRUE;
+ $this->dialog= TRUE;
+ }
}
/* Cancel forward add dialog? */
- if (isset($_POST['add_locals_cancel'])){
- $this->forward_dialog= FALSE;
- $this->dialog= FALSE;
+ if($this->acl_is_writeable("gosaMailForwardingAddress")){
+ if (isset($_POST['add_locals_cancel'])){
+ $this->forward_dialog= FALSE;
+ $this->dialog= FALSE;
+ }
}
/* Finished adding of locals? */
- if (isset($_POST['add_locals_finish'])){
+ if ((isset($_POST['add_locals_finish'])) && ($this->acl_is_writeable("gosaMailForwardingAddress"))) {
if (count ($_POST['local_list']) && $this->acl_is_writeable("gosaMailForwardingAddress")){
/* Walk through list of forwarders, ignore own addresses */
}
/* Add forward email addresses */
- if (isset($_POST['add_forwarder'])){
+ if ((isset($_POST['add_forwarder'])) && ($this->acl_is_writeable("gosaMailForwardingAddress"))){
if ($_POST['forward_address'] != ""){
/* Valid email address specified? */
}
/* Delete forward email addresses */
- if (isset($_POST['delete_forwarder'])){
+ if (isset($_POST['delete_forwarder']) && ($this->acl_is_writeable("gosaMailForwardingAddress"))){
if (count($_POST['forwarder_list'])&& $this->acl_is_writeable("gosaMailForwardingAddress")){
$this->delForwarder ($_POST['forwarder_list']);
}
/* Delete alternate email addresses */
- if (isset($_POST['delete_alternate']) && isset ($_POST['alternates_list'])){
- if (count($_POST['alternates_list']) && $this->acl_is_writeable("gosaMailAlternateAddress")){
-
- $this->delAlternate ($_POST['alternates_list']);
+ if($this->acl_is_writeable("gosaMailAlternateAddress")){
+ if (isset($_POST['delete_alternate']) && isset ($_POST['alternates_list'])){
+ if (count($_POST['alternates_list']) && $this->acl_is_writeable("gosaMailAlternateAddress")){
+ $this->delAlternate ($_POST['alternates_list']);
+ }
}
}
I: Only insider delivery */
if (isset($_POST['mailedit'])){
- /* Save ldap attributes */
plugin::save_object();
- $tmp= "";
- if (!isset($_POST["drop_own_mails"])){
- $tmp.= "L";
- }
- if (isset($_POST["use_mailsize_limit"])){
- $tmp.= "R";
- }
- if (isset($_POST["use_spam_filter"])){
- $tmp.= "S";
- }
- if (isset($_POST["use_vacation"])){
- $tmp.= "V";
- }
- if (isset($_POST["own_script"])){
- $tmp.= "C";
+ $tmp= preg_replace("/[^a-z]/i","",$this->gosaMailDeliveryMode);
+
+ /* Handle delivery flags */
+ if($this->acl_is_writeable("gosaMailDeliveryModeL")){
+ if(!preg_match("/L/",$tmp) && !isset($_POST['drop_own_mails'])){
+ $tmp.="L";
+ }elseif(preg_match("/L/",$tmp) && isset($_POST['drop_own_mails'])){
+ $tmp = preg_replace("/L/","",$tmp);
+ }
}
- if (isset($_POST["only_local"])){
- $tmp.= "I";
+
+ $opts = array(
+ "R" => "use_mailsize_limit",
+ "S" => "use_spam_filter",
+ "V" => "use_vacation",
+ "C" => "own_script",
+ "I" => "only_local");
+
+ foreach($opts as $flag => $post){
+ if($this->acl_is_writeable("gosaMailDeliveryMode".$flag)){
+ if(!preg_match("/".$flag."/",$tmp) && isset($_POST[$post])){
+ $tmp.= $flag;
+ }elseif(preg_match("/".$flag."/",$tmp) && !isset($_POST[$post])){
+ $tmp = preg_replace("/".$flag."/","",$tmp);
+ }
+ }
}
- $tmp= "[$tmp]";
- if ($this->getacl("gosaMailDeliveryMode")){
- $this->gosaMailDeliveryMode= $tmp;
+ $tmp= "[$tmp]";
+ if ($this->gosaMailDeliveryMode != $tmp){
+ $this->is_modified= TRUE;
}
+ $this->gosaMailDeliveryMode= $tmp;
/* Collect data and re-assign it to the imapacl array */
- if ($this->acl_is_writeable("permissions")){
+ if ($this->acl_is_writeable("acl")){
$this->imapacl= array();
$this->imapacl['%members%']= $_POST['member_permissions'];
$this->imapacl['anyone']= $_POST['default_permissions'];