Code

Updated kolab service
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Mar 2010 14:23:52 +0000 (14:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Mar 2010 14:23:52 +0000 (14:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16956 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc
gosa-plugins/kolab/admin/systems/services/kolab/servkolab.tpl

index 96f54b7e33e747a674e4bfd30076e420cd026859..d8ca73c63caedb1a2c20f6dcd934780ab29e2c5f 100644 (file)
@@ -149,10 +149,8 @@ class servkolab extends goService {
     $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;'");
+      $f2 = array("string" => image('images/lists/trash.png', 'remove_domain_'.$key, _("Remove")),
+          "attach" => "style='border-right:0px; width: 20px;'");
       $divlist->AddEntry(array($f1,$f2));
     }
     $smarty->assign("mdDiv",$divlist->DrawList());
@@ -250,7 +248,7 @@ class servkolab extends goService {
        */
       foreach($_POST as $name => $value){
         if(preg_match("/^remove_domain_/",$name)){
-          $id = preg_replace("/^remove_domain_([0-9]*)_.*$/","\\1",$name);
+          $id = preg_replace("/^remove_domain_([0-9]*)$/","\\1",$name);
           if(isset($this->postfix_mydestination[$id])){
             unset($this->postfix_mydestination[$id]);
           }
@@ -259,8 +257,13 @@ class servkolab extends goService {
       }
       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;
+        if(!empty($new_domain)){
+          if(tests::is_domain($new_domain)){
+            $this->postfix_mydestination[] = $new_domain;
+            $this->postfix_mydestination = array_unique($this->postfix_mydestination);
+          }else{
+            msg_dialog::display(_("Info"), msgPool::invalid(_("Mail domain")));
+          }
         }
       }
 
index a7a4246e665a5ff951436e1ef7a9289d3dde6440..0610c8739458dd9315f3a5aa493102f92a8d7171 100644 (file)
@@ -7,7 +7,7 @@
         <td colspan="2"><b>{t}Generic{/t}</b></td>
        </tr>
        <tr>
-               <td>{t}Postfix mydomain{/t}
+               <td>{t}Postfix mydomain{/t}&nbsp;{$must}
                </td>
                <td>
 {render acl=$postfixmydomainACL}
@@ -25,7 +25,8 @@
                </td>
        </tr>
        <tr>
-               <td colspan="2">{t}Mail domains{/t}&nbsp;({t}Postfix mydestination{/t})<br>
+               <td colspan="2">{t}Mail domains{/t}&nbsp;({t}Postfix mydestination{/t})&nbsp;{$must}
+<br>
 {render acl=$postfixmydestinationACL}
                {$mdDiv}
 {/render}