summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b125ec2)
raw | patch | inline | side by side (parent: b125ec2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Dec 2008 13:51:28 +0000 (13:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Dec 2008 13:51:28 +0000 (13:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13205 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc | patch | blob | history | |
gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl | patch | blob | history |
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 8bb7999db7e0b95e2975da9b4df8d9eb4c11a02e..f1e8b04c705fe8bde510909b5c32f5258af25888 100644 (file)
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 = "";
$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];
+ }
+ }
}
$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" => "<input type='image' src='images/lists/trash.png'
+ name='remove_domain_".$key."'
+ title='"._("Remove")."' alt='"._("Remove")."'>",
+ "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);
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];
$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 055b0d401d8cbc983042a98b9106cb6e4e6aa181..834a943dd98997a9e67fc3e8e59fb5191c0ef424 100644 (file)
<table summary="" style="width:100%">
<tr>
<td style="vertical-align:top; border-right:1px solid #A0A0A0; padding-right:5px;" width="50%">
- <table summary="">
+ <table summary="" width="100%">
<tr>
<td colspan="2"><b>{t}Generic{/t}</b></td>
</tr>
</td>
</tr>
<tr>
- <td>{t}Postfix mydestination{/t}
+ <td>{t}Cyrus admins{/t}
</td>
<td>
-{render acl=$postfixmydestinationACL}
- <input type="text" name="postfix_mydestination" value="{$postfix_mydestination}">
+{render acl=$cyrusadminsACL}
+ <input type="text" name="cyrus_admins" value="{$cyrus_admins}">
{/render}
</td>
</tr>
<tr>
- <td>{t}Cyrus admins{/t}
- </td>
- <td>
-{render acl=$cyrusadminsACL}
- <input type="text" name="cyrus_admins" value="{$cyrus_admins}">
+ <td colspan="2">{t}Mail domains{/t} ({t}Postfix mydestination{/t})<br>
+{render acl=$postfixmydestinationACL}
+ {$mdDiv}
+{/render}
+{render acl=$postfixmydestinationACL}
+ <input size="30" type='text' name='new_domain_name' value=''>
+{/render}
+{render acl=$postfixmydestinationACL}
+ <input type='submit' name='add_domain_name' value='{msgPool type=addButton}'>
{/render}
</td>
</tr>