From 4a040f5be40d71a3c746afbe4f2566c779aed5f9 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 9 Dec 2008 13:51:28 +0000 Subject: [PATCH] Updated kolab service git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13205 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/kolab/class_servKolab.inc | 50 ++++++++++++++++++- .../systems/services/kolab/servkolab.tpl | 22 ++++---- 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc b/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc index 8bb7999db..f1e8b04c7 100644 --- a/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc +++ b/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc @@ -3,7 +3,7 @@ class servkolab extends goService { var $postfix_mydomain = ""; var $cyrus_admins = ""; - var $postfix_mydestination = ""; + var $postfix_mydestination = array(); var $postfix_mynetworks = "127.0.0.1/8"; var $postfix_enable_virus_scan = "TRUE"; var $postfix_relayhost = ""; @@ -69,7 +69,16 @@ class servkolab extends goService { $this->is_account = true; $this->initially_was_account = true; } - } + } + + /* Get list of configured domains + */ + $this->postfix_mydestination = array(); + if(isset($this->attrs['postfix-mydestination'])){ + for($i=0; $i < $this->attrs['postfix-mydestination']['count']; $i++){ + $this->postfix_mydestination[] = $this->attrs['postfix-mydestination'][$i]; + } + } } @@ -134,6 +143,20 @@ class servkolab extends goService { $smarty->assign("fbfuture", $fbfuture); $smarty->assign("quotastr", $quotastr); + /* Create mail domain divlist (postfix_mydestination) + */ + $divlist = new divSelectBox("fuse"); + $divlist->setHeight(100); + foreach($this->postfix_mydestination as $key => $domain){ + $f1 = array("string" => $domain); + $f2 = array("string" => "", + "attach" => "style='border-right:0px; width: 20px;'"); + $divlist->AddEntry(array($f1,$f2)); + } + $smarty->assign("mdDiv",$divlist->DrawList()); + /* Load Template */ $display.=$smarty->fetch(get_template_path('servkolab.tpl', TRUE,dirname(__FILE__))); return ($display); @@ -223,7 +246,26 @@ class servkolab extends goService { if (isset($_POST['kolabtab'])){ plugin::save_object(); + /* Domain name added/removed + */ + foreach($_POST as $name => $value){ + if(preg_match("/^remove_domain_/",$name)){ + $id = preg_replace("/^remove_domain_([0-9]*)_.*$/","\\1",$name); + if(isset($this->postfix_mydestination[$id])){ + unset($this->postfix_mydestination[$id]); + } + break; + } + } + if(isset($_POST['add_domain_name']) && isset($_POST['new_domain_name'])){ + $new_domain = trim(get_post('new_domain_name')); + if(!empty($new_domain) && tests::is_domain($new_domain)){ + $this->postfix_mydestination[] = $new_domain; + } + } + /* Map attrinutes + */ foreach($this->attributes as $attr){ if(($this->acl_is_writeable(preg_replace("/_/","",$attr))) && (isset($_POST[$attr]))){ $this->$attr = $_POST[$attr]; @@ -277,6 +319,10 @@ class servkolab extends goService { $message[] = msgPool::required(_("Privileged networks")); } + if(!count($this->postfix_mydestination)){ + $message[] = msgPool::required(_("Mail domains")." (postfix-mydestination)" ); + } + return ($message); } diff --git a/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl b/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl index 055b0d401..834a943dd 100644 --- a/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl +++ b/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl @@ -1,7 +1,7 @@
- +
@@ -15,20 +15,24 @@ - - - -- 2.30.2
{t}Generic{/t}
{t}Postfix mydestination{/t} + {t}Cyrus admins{/t} -{render acl=$postfixmydestinationACL} - +{render acl=$cyrusadminsACL} + {/render}
{t}Cyrus admins{/t} - -{render acl=$cyrusadminsACL} - + {t}Mail domains{/t} ({t}Postfix mydestination{/t})
+{render acl=$postfixmydestinationACL} + {$mdDiv} +{/render} +{render acl=$postfixmydestinationACL} + +{/render} +{render acl=$postfixmydestinationACL} + {/render}