From e1c0b60c85fe50483f19c1029855086ff4d8f42d Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 22 Mar 2010 10:45:39 +0000 Subject: [PATCH] Updated Spamserver templates and acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16987 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/spam/class_goSpamServer.inc | 4 + .../services/spam/class_goSpamServerRule.inc | 6 + .../systems/services/spam/goSpamServer.tpl | 145 +++++++++--------- .../services/spam/goSpamServerRule.tpl | 34 ++-- 4 files changed, 92 insertions(+), 97 deletions(-) diff --git a/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc b/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc index 2967a40e9..892607e9b 100644 --- a/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc +++ b/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc @@ -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; diff --git a/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServerRule.inc b/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServerRule.inc index ba5673db5..9ffa19088 100644 --- a/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServerRule.inc +++ b/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServerRule.inc @@ -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() { diff --git a/gosa-plugins/mail/admin/systems/services/spam/goSpamServer.tpl b/gosa-plugins/mail/admin/systems/services/spam/goSpamServer.tpl index b12503261..9699efffb 100644 --- a/gosa-plugins/mail/admin/systems/services/spam/goSpamServer.tpl +++ b/gosa-plugins/mail/admin/systems/services/spam/goSpamServer.tpl @@ -1,60 +1,54 @@ - + +
@@ -64,42 +58,43 @@ @@ -108,30 +103,30 @@ - +
-

Spam tagging

- - +

{t}Spam tagging{/t}

+
+ - + -
{t}Rewrite header{/t} - {t}Rewrite header{/t} - -{render acl=$saRewriteHeaderACL} - -{/render} + {render acl=$saRewriteHeaderACL} + + {/render}
{t}Required score{/t} - {t}Required score{/t} - -{render acl=$saRequiredScoreACL} - -{/render} + {render acl=$saRequiredScoreACL} + + {/render}
-
-

Trusted networks

+ +

Trusted networks

- +
-{render acl=$saTrustedNetworksACL} -
-{/render} -{render acl=$saTrustedNetworksACL} -   -{/render} -{render acl=$saTrustedNetworksACL} - - -{/render} -{render acl=$saTrustedNetworksACL} - - -{/render} + {render acl=$saTrustedNetworksACL} + +
+ {/render} + {render acl=$saTrustedNetworksACL} +   + {/render} + {render acl=$saTrustedNetworksACL} + + {/render} + {render acl=$saTrustedNetworksACL} + + {/render}
-
-

Flags

- - +

{t}Flags{/t}

+
-{render acl=$saFlagsBACL} -  {t}Enable use of bayes filtering{/t}
-{/render} -{render acl=$saFlagsbACL} -  {t}Enable bayes auto learning{/t}
-{/render} -{render acl=$saFlagsCACL} -  {t}Enable RBL checks{/t} -{/render} + {render acl=$saFlagsBACL} +  {t}Enable use of bayes filtering{/t} + {/render} +
+ {render acl=$saFlagsbACL} +  {t}Enable bayes auto learning{/t} + {/render} +
+ {render acl=$saFlagsCACL} +  {t}Enable RBL checks{/t} + {/render}
- - +
-{render acl=$saFlagsRACL} -  {t}Enable use of Razor{/t}
-{/render} -{render acl=$saFlagsDACL} -  {t}Enable use of DDC{/t}
-{/render} -{render acl=$saFlagsPACL} -  {t}Enable use of Pyzor{/t} -{/render} + {render acl=$saFlagsRACL} +  {t}Enable use of Razor{/t} + {/render} +
+ {render acl=$saFlagsDACL} +  {t}Enable use of DDC{/t} + {/render} +
+ {render acl=$saFlagsPACL} +  {t}Enable use of Pyzor{/t} + {/render}
-

Rules

+
+

{t}Rules{/t}

- +
- {$divRules}
-{render acl=$saTrustedNetworksACL} - - -{/render} + {$divRules} +
+ {render acl=$saTrustedNetworksACL} + + {/render}
+
-
- - -   - +
+ +
- diff --git a/gosa-plugins/mail/admin/systems/services/spam/goSpamServerRule.tpl b/gosa-plugins/mail/admin/systems/services/spam/goSpamServerRule.tpl index 1850933d2..4131b2729 100644 --- a/gosa-plugins/mail/admin/systems/services/spam/goSpamServerRule.tpl +++ b/gosa-plugins/mail/admin/systems/services/spam/goSpamServerRule.tpl @@ -1,27 +1,17 @@ -

Edit spam rule

+

+{t}Name{/t} + +

- - - - - - - - -
- {t}Name{/t} - - -
- {t}Rule{/t} - -

-
- -   - +

{t}Rule{/t}

+ +
+
+   +
- -- 2.30.2