From 456e406b36e4b76e8c0c6e62c6aefe383378d3ff Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 1 Aug 2006 05:40:14 +0000 Subject: [PATCH] Some fixes git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4353 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_goSpamServer.inc | 20 ++++++++++++++++--- .../admin/systems/class_goSpamServerRule.inc | 7 ++++++- plugins/admin/systems/class_goVirusServer.inc | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/plugins/admin/systems/class_goSpamServer.inc b/plugins/admin/systems/class_goSpamServer.inc index 055496bf8..de52e2064 100644 --- a/plugins/admin/systems/class_goSpamServer.inc +++ b/plugins/admin/systems/class_goSpamServer.inc @@ -1,7 +1,12 @@ "Eins ist toll", "zwei" => "Zwei ist noch besser"); + /* This plugin only writes its objectClass */ var $objectclasses = array("goSpamServer"); var $attributes = array("saRewriteHeader","saTrustedNetworks","saRequiredScore","saFlags","saRule"); @@ -35,7 +40,7 @@ class goSpamServer extends plugin{ var $ui = NULL; var $acl = NULL; - function goSpamServer($config,$dn) + function gospamserver($config,$dn) { /* Init class */ plugin::plugin($config,$dn); @@ -293,6 +298,12 @@ class goSpamServer extends plugin{ function check() { $message = plugin::check(); + + /* Check if required score is numeric */ + if(!is_numeric($this->saRequiredScore)){ + $message[] = _("Required score must be a numeric value."); + } + return($message); } @@ -300,7 +311,10 @@ class goSpamServer extends plugin{ function save_object() { if(isset($_POST['goSpamServer'])){ + plugin::save_object(); + + /* Check flags */ foreach($this->Flags as $flag){ $var = "saFlags".$flag; if(isset($_POST[$var])){ diff --git a/plugins/admin/systems/class_goSpamServerRule.inc b/plugins/admin/systems/class_goSpamServerRule.inc index 4883ba99f..178269534 100644 --- a/plugins/admin/systems/class_goSpamServerRule.inc +++ b/plugins/admin/systems/class_goSpamServerRule.inc @@ -27,6 +27,11 @@ class goSpamServerRule extends plugin { function save_object() { plugin::save_object(); + foreach($this->attributes as $attr){ + if(isset($_POST[$attr])){ + $this->$attr = $_POST[$attr]; + } + } } @@ -45,5 +50,5 @@ class goSpamServerRule extends plugin { return($messages); } } - +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goVirusServer.inc b/plugins/admin/systems/class_goVirusServer.inc index 273fba3ce..3cd2469cf 100644 --- a/plugins/admin/systems/class_goVirusServer.inc +++ b/plugins/admin/systems/class_goVirusServer.inc @@ -1,6 +1,6 @@