From: hickert Date: Thu, 15 Sep 2011 09:00:01 +0000 (+0000) Subject: Backported from trunk X-Git-Url: https://git.tokkee.org/?p=gosa.git;a=commitdiff_plain;h=9a016342fbc44ed81cbac557b4d00e6310b1cf7e Backported from trunk -Kolab my-metworks is a multivalue now. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.7@20998 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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 2a91090d2..2f15dc787 100644 --- a/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc +++ b/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc @@ -57,6 +57,8 @@ class servkolab extends goService /* Toggle relayhost */ $this->postfix_mxrelayenabled = preg_match('/^\[/', $this->postfix_relayhost); $this->postfix_relayhost = preg_replace("/[\[\]]/","",$this->postfix_relayhost); + + $this->postfix_mynetworksData = preg_split("/[ ,]/", $this->postfix_mynetworks,0, PREG_SPLIT_NO_EMPTY); /* Is this Server a member of the Kolab extension or not ?*/ if(isset($this->attrs['kolabHost'])) { @@ -91,6 +93,17 @@ class servkolab extends goService $this->postfix_mydestinationList->setColspecs(array('*','20px')); $this->postfix_mydestinationList->setHeader(array(_("Name"))); $this->postfix_mydestinationList->setDefaultSortColumn(0); + + // Prepare lists + $this->postfix_mynetworksList = new sortableListing(); + $this->postfix_mynetworksList->setDeleteable(true); + $this->postfix_mynetworksList->setInstantDelete(true); + $this->postfix_mynetworksList->setEditable(false); + $this->postfix_mynetworksList->setWidth("100%"); + $this->postfix_mynetworksList->setHeight("100px"); + $this->postfix_mynetworksList->setColspecs(array('*','20px')); + $this->postfix_mynetworksList->setHeader(array(_("Name"))); + $this->postfix_mynetworksList->setDefaultSortColumn(0); } @@ -144,6 +157,25 @@ class servkolab extends goService } } + + /* Domain name added/removed + */ + if($this->acl_is_writeable("postfixmynetworks")){ + $this->postfix_mynetworksList->save_object(); + $action = $this->postfix_mynetworksList->getAction(); + if($action['action'] == 'delete'){ + $this->postfix_mynetworksData = $this->postfix_mynetworksList->getMaintainedData(); + } + if(isset($_POST['new_network_name']) && isset($_POST['add_network_name'])){ + $new_domain = trim(get_post('new_network_name')); + if(!empty($new_domain)){ + $this->postfix_mynetworksData[] = $new_domain; + $this->postfix_mynetworksData = array_unique($this->postfix_mynetworksData); + } + } + } + + /*************** Assign informations to smarty ***************/ @@ -181,6 +213,11 @@ class servkolab extends goService $this->postfix_mydestinationList->update(); $smarty->assign("mdDiv",$this->postfix_mydestinationList->render()); + $this->postfix_mynetworksList->setAcl($this->getacl("postfixmynetworks")); + $this->postfix_mynetworksList->setListData($this->postfix_mynetworksData); + $this->postfix_mynetworksList->update(); + $smarty->assign("networkDiv",$this->postfix_mynetworksList->render()); + /* Load Template */ $display.=$smarty->fetch(get_template_path('servkolab.tpl', TRUE,dirname(__FILE__))); return ($display); @@ -353,6 +390,8 @@ class servkolab extends goService $this->postfix_relayhost= "[".$this->postfix_relayhost."]"; } + $this->postfix_mynetworks = implode($this->postfix_mynetworksData, ','); + /* Check if this server was renamed, in this case we have to remove old cn first*/ if($this->hostname != $this->cn){ $tmp = array(); diff --git a/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl b/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl index dc1fcf260..7984cb22d 100644 --- a/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl +++ b/gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl @@ -175,18 +175,17 @@

{t}SMTP privileged networks{/t}

- - - - -
{render acl=$postfixmynetworksACL} - + {$networkDiv} + {/render} + {render acl=$postfixmynetworksACL} + + {/render} + {render acl=$postfixmynetworksACL} + {/render} - ( {t}Enter multiple values, separated with{/t} , ) -