Code

Updated Spamserver templates and acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Mar 2010 10:45:39 +0000 (10:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Mar 2010 10:45:39 +0000 (10:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16987 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc
gosa-plugins/mail/admin/systems/services/spam/class_goSpamServerRule.inc
gosa-plugins/mail/admin/systems/services/spam/goSpamServer.tpl
gosa-plugins/mail/admin/systems/services/spam/goSpamServerRule.tpl

index 2967a40e99509e6511f62b1c31b8a9951f6e7767..892607e9b5e4fa7667aa89701f358850db8de57d 100644 (file)
@@ -108,6 +108,8 @@ class gospamserver extends goService{
     /* Add a new rule */
     if(isset($_POST['AddRule']) && $this->acl_is_writeable("saRule")){
       $this->dialog = new goSpamServerRule($this->config,$this->dn);
+      $this->dialog->acl_base = $this->acl_base;
+      $this->dialog->acl_category = $this->acl_category;
     }
   
     /* Cancel adding/editing specified rule */
@@ -125,6 +127,8 @@ class gospamserver extends goService{
         $rule = $this->Rules[$entry];
         $name = $entry;
         $this->dialog = new goSpamServerRule($this->config,$this->dn,$name,$rule);
+        $this->dialog->acl_base = $this->acl_base;
+        $this->dialog->acl_category = $this->acl_category;
       }
       if(preg_match("/^delRule_/",$name) && $once && $this->acl_is_writeable("saRule")){
         $once = false;
index ba5673db5085c5e2c055954b71104912fd04f662..9ffa19088635f7ecd069c3a42aa4d1b3aef69b22 100644 (file)
@@ -43,6 +43,12 @@ class goSpamServerRule extends plugin {
                }
        }
 
+  function acl_is_writeable($attribute,$skip_write = FALSE)
+  {
+    if($this->read_only) return(FALSE);
+    $ui= get_userinfo();
+    return preg_match('/w/', $ui->get_permissions($this->acl_base, $this->acl_category."gospamserver", $attribute,      $skip_write));
+  }
 
        function save()
        {
index b125032614d73669eceb77b422909b7ea2826a8d..9699efffbb639b6df98e8cd4bc302e48fea5cb74 100644 (file)
@@ -1,60 +1,54 @@
-<table style='width:100%'>
+
+<table style='width:100%' summary="{t}Spam taggin{/t}">
  <tr>
   <td style='width:50%;'>
-<h3>Spam tagging</h3>
-
-   <table>
+   <h3>{t}Spam tagging{/t}</h3>
+   <table summary="{t}Spam taggin{/t}">
     <tr>
+     <td>{t}Rewrite header{/t}</td>
      <td>
-      {t}Rewrite header{/t}      
-     </td>
-     <td>
-{render acl=$saRewriteHeaderACL}
-      <input type='text' name='saRewriteHeader' value='{$saRewriteHeader}'>
-{/render}
+      {render acl=$saRewriteHeaderACL}
+       <input type='text' name='saRewriteHeader' value='{$saRewriteHeader}'>
+      {/render}
      </td>
     </tr>
     <tr>
+     <td>{t}Required score{/t}</td>
      <td>
-      {t}Required score{/t}      
-     </td>
-     <td>
-{render acl=$saRequiredScoreACL}
-      <select name='saRequiredScore' title='{t}Select required score to tag mail as spam{/t}' size=1>
-       {html_options options=$SpamScore selected=$saRequiredScore}
-      </select>
-{/render}
+      {render acl=$saRequiredScoreACL}
+       <select name='saRequiredScore' title='{t}Select required score to tag mail as spam{/t}' size=1>
+        {html_options options=$SpamScore selected=$saRequiredScore}
+       </select>
+      {/render}
      </td>
     </tr>
    </table>
-
   </td>
   <td class='left-border'>
-<h3>Trusted networks</h3>
+  
+   <h3>Trusted networks</h3>
 
-   <table width='100%'>
+   <table width='100%' summary="{t}Network settings{/t}">
     <tr>
      <td>
-{render acl=$saTrustedNetworksACL}
-      <select name='TrustedNetworks[]' size=4 style='width:100%;' multiple>
-       {html_options options=$TrustedNetworks}
-      </select><br>
-{/render}
-{render acl=$saTrustedNetworksACL}
-      <input type='text'       name='NewTrustName' value=''>&nbsp;
-{/render}
-{render acl=$saTrustedNetworksACL}
-      <button type='submit' name='AddNewTrust'>{msgPool type=addButton}</button>
-
-{/render}
-{render acl=$saTrustedNetworksACL}
-      <button type='submit' name='DelTrust'>{t}Remove{/t}</button>
-
-{/render}
+      {render acl=$saTrustedNetworksACL}
+       <select name='TrustedNetworks[]' size=4 style='width:100%;' multiple>
+        {html_options options=$TrustedNetworks}
+       </select>
+       <br>
+      {/render}
+      {render acl=$saTrustedNetworksACL}
+       <input type='text'      name='NewTrustName' value=''>&nbsp;
+      {/render}
+      {render acl=$saTrustedNetworksACL}
+       <button type='submit' name='AddNewTrust'>{msgPool type=addButton}</button>
+      {/render}
+      {render acl=$saTrustedNetworksACL}
+       <button type='submit' name='DelTrust'>{t}Remove{/t}</button>
+      {/render}
      </td>
     </tr>
    </table>
-
   </td>
  </tr>
  <tr>
  </tr>
  <tr>
   <td>
-       <h3>Flags</h3>
-       
-   <table>
+   <h3>{t}Flags{/t}</h3>
+   <table summary="{t}Flags{/t}">
     <tr>
      <td>
-{render acl=$saFlagsBACL}
-      <input type='checkbox' name='saFlagsB' value='1' {$saFlagsBCHK}> &nbsp;{t}Enable use of bayes filtering{/t}<br>
-{/render}
-{render acl=$saFlagsbACL}
-      <input type='checkbox' name='saFlagsb' value='1' {$saFlagsbCHK}> &nbsp;{t}Enable bayes auto learning{/t}<br>
-{/render}
-{render acl=$saFlagsCACL}
-      <input type='checkbox' name='saFlagsC' value='1' {$saFlagsCCHK}> &nbsp;{t}Enable RBL checks{/t}
-{/render}
+      {render acl=$saFlagsBACL}
+       <input type='checkbox' name='saFlagsB' value='1' {$saFlagsBCHK}> &nbsp;{t}Enable use of bayes filtering{/t}
+      {/render}
+      <br>
+      {render acl=$saFlagsbACL}
+       <input type='checkbox' name='saFlagsb' value='1' {$saFlagsbCHK}> &nbsp;{t}Enable bayes auto learning{/t}
+      {/render}
+      <br>
+      {render acl=$saFlagsCACL}
+       <input type='checkbox' name='saFlagsC' value='1' {$saFlagsCCHK}> &nbsp;{t}Enable RBL checks{/t}
+      {/render}
      </td>
     </tr>
    </table>
   </td>
   <td class='left-border'>
-
-   <table>
+   <table summary="{t}Flags{/t}">
     <tr>
      <td>
-{render acl=$saFlagsRACL}
-      <input type='checkbox' name='saFlagsR' value='1' {$saFlagsRCHK}> &nbsp;{t}Enable use of Razor{/t}<br>
-{/render}
-{render acl=$saFlagsDACL}
-      <input type='checkbox' name='saFlagsD' value='1' {$saFlagsDCHK}> &nbsp;{t}Enable use of DDC{/t}<br>
-{/render}
-{render acl=$saFlagsPACL}
-      <input type='checkbox' name='saFlagsP' value='1' {$saFlagsPCHK}> &nbsp;{t}Enable use of Pyzor{/t}
-{/render}
+      {render acl=$saFlagsRACL}
+       <input type='checkbox' name='saFlagsR' value='1' {$saFlagsRCHK}> &nbsp;{t}Enable use of Razor{/t}
+      {/render}
+      <br>
+      {render acl=$saFlagsDACL}
+       <input type='checkbox' name='saFlagsD' value='1' {$saFlagsDCHK}> &nbsp;{t}Enable use of DDC{/t}
+      {/render}
+      <br>
+      {render acl=$saFlagsPACL}
+       <input type='checkbox' name='saFlagsP' value='1' {$saFlagsPCHK}> &nbsp;{t}Enable use of Pyzor{/t}
+      {/render}
      </td>
     </tr>
    </table>
-
   </td>
  </tr>
  <tr>
   </td>
  </tr>
  <tr>
-  <td colspan='2'><h3>Rules</h3>
+  <td colspan='2'>
+   <h3>{t}Rules{/t}</h3>
 
-   <table width='100%'>
+   <table width='100%' summary="{t}Rules{/t}">
     <tr>
      <td>
-      {$divRules}<br>
-{render acl=$saTrustedNetworksACL}
-      <button type='submit' name='AddRule'>{msgPool type=addButton}</button> 
-
-{/render}
+      {$divRules}
+      <br>
+      {render acl=$saTrustedNetworksACL}
+       <button type='submit' name='AddRule'>{msgPool type=addButton}</button>
+      {/render}
      </td>
     </tr>
    </table>
 
   </td>
+ </tr>
 </table>
+
 <input type='hidden' value='1' name='goSpamServer'>
 
 <hr>
-<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
-    <button type='submit' name='SaveService'>{msgPool type=saveButton}</button>
-
-    &nbsp;
-    <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
 
+<div class="plugin-actions">
+  <button type='submit' name='SaveService'>{msgPool type=saveButton}</button>
+  <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
 </div>
-
index 1850933d2b62d00a1ffe5233d07a4194870085b2..4131b2729e0415b900fccc8301086c5fc79115d8 100644 (file)
@@ -1,27 +1,17 @@
-<h3>Edit spam rule</h3>
+<p>
+{t}Name{/t}
+<input type='text' name='name' value='{$name}' >
+</p>
 
-<table style='width:100%;'>
- <tr>
-  <td width='70'>
-   {t}Name{/t}
-  </td>
-  <td>
-   <input type='text' name='name' value='{$name}' >
-  </td>
- </tr>
- <tr>
-  <td colspan=2>
-   {t}Rule{/t}
-   <textarea name='rule' style='width:100%;'>{$rule}</textarea>
-  </td>
- </tr>
-</table>
 <hr>
-<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
-    <button type='submit' name='SaveRule'>{msgPool type=saveButton}</button>
 
-    &nbsp;
-    <button type='submit' name='CancelRule'>{msgPool type=cancelButton}</button>
+<h3>{t}Rule{/t}</h3>
+<textarea name='rule' style='width:100%;'>{$rule}</textarea>
 
+<hr>
+<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
+ <button type='submit' name='SaveRule'>
+ {msgPool type=saveButton}</button>&nbsp;
+ <button type='submit' name='CancelRule'>
+ {msgPool type=cancelButton}</button>
 </div>
-