Code

Added mail size limit option
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 11 Oct 2010 13:29:51 +0000 (13:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 11 Oct 2010 13:29:51 +0000 (13:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19978 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/admin/ogroups/DistributionList/class_DistributionList.inc
gosa-plugins/groupware/admin/ogroups/DistributionList/generic.tpl

index 0b3e2aa1ada0fb1917d61624a0607898f3ea8601..bbb081b7ebcdccf6a94792d0bf54c8bb237d0fbb 100644 (file)
@@ -9,8 +9,12 @@ class DistributionList extends plugin
 
     public $view_logged = FALSE;
 
-    public $attributes = array('primaryMailAddress','alternateAddresses','memberList');
+    public $attributes = array('primaryMailAddress','alternateAddresses','memberList','mailSizeLimit');
 
+    public $mailSizeLimit = NULL;
+    public $primaryMailAddress = "";
+    public $alternateAddresses = array();
+    public $memberList = array();
 
     function __construct($config, $dn, $attrs = NULL)
     {
@@ -187,11 +191,12 @@ class DistributionList extends plugin
 
         $smarty = get_smarty();
         $smarty->assign('rpcError' , $this->rpcError);
-        foreach(array("primaryMailAddress","alternateAddresses") as $attr){
+        foreach(array("primaryMailAddress","alternateAddresses","mailSizeLimit") as $attr){
             $smarty->assign("{$attr}ACL", $this->getacl($attr));
             $smarty->assign($attr, set_post($this->$attr));
         }
 
+        $smarty->assign("useMailSizeLimit", ($this->mailSizeLimit != NULL));
         $smarty->assign("memberList", set_post($this->memberList));
         $smarty->assign('rpcErrorMessage' , $this->rpcErrorMessage);
         return($display.$smarty->fetch(get_template_path('DistributionList/generic.tpl', TRUE)));
@@ -213,6 +218,7 @@ class DistributionList extends plugin
                     "plOptions"       => array(),
                     "plProvidedAcls"  => array(
                         "primaryMailAddress"   => _("Mail address"),
+                        "mailSizeLimit"   => _("Mail size limit"),
                         "alternateAddresses"   => _("Alternate mail addresses"))
                         ));
     }
@@ -222,11 +228,13 @@ class DistributionList extends plugin
 
     function save_object()
     {
-    
-        if(isset($_POST['retryInit'])){
-            $this->init();
+        if(isset($_POST['DistributionList_posted'])){
+            if(isset($_POST['retryInit'])){
+                $this->init();
+            }
+            if(!isset($_POST['useMailSizeLimit'])) $this->mailSizeLimit = NULL;
+            plugin::save_object();
         }
-        plugin::save_object();
     }
 
 
index c06dacac3de56436e3376e94e0130fc290c00bc5..1f48768356350538972cc31c739b7d29fbe1d271 100644 (file)
@@ -3,10 +3,23 @@
     <tr>
         <td style='width:50%; vertical-align: top;' class='right-border'>
             <h3>{t}Groupware{/t}</h3>
+
             {t}Mail address{/t}:
             {render acl=$primaryMailAddressACL}
                 <input type='text' name="primaryMailAddress" value="{$primaryMailAddress}">
             {/render}
+            <hr>
+
+            {render acl=$mailSizeLimitACL}
+                <input type='checkbox' name="useMailSizeLimit" 
+                    onClick="changeState('mailSizeLimit')" 
+                    {if $useMailSizeLimit} checked {/if} value="1">
+            {/render}
+            {t}Use incoming mail size limitation{/t}
+            {render acl=$mailSizeLimitACL}
+                <input type='text' name='mailSizeLimit' id="mailSizeLimit" 
+                    {if $useMailSizeLimit} value="{$mailSizeLimit}" {else} value="" disabled {/if}>
+            {/render}
         </td>
         <td style='width:50%; vertical-align: top;'>
             <h3><label for="alternateAddressList">{t}Alternative addresses{/t}</label></h3>
@@ -31,4 +44,4 @@
     </tr>
 </table>
 
-
+<input type="hidden" name="DistributionList_posted" value="1">