From: Daniel Nauck <d...@mono-project.de>

 * add support for loading and saving the default admin settings for 
optOutClamAV
 * add optOutClamAV to the user satus view
---
 webui/cgi-bin/admin.cgi |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/webui/cgi-bin/admin.cgi b/webui/cgi-bin/admin.cgi
index 61469c6..fd1d8f4 100755
--- a/webui/cgi-bin/admin.cgi
+++ b/webui/cgi-bin/admin.cgi
@@ -161,6 +161,10 @@ sub DisplayPreferences {
 
   if ($FORM{'submit'} ne "") {
 
+    if ($FORM{'optOutClamAV'} ne "on") {
+      $FORM{'optOutClamAV'} = "off";
+    }
+
     if ($FORM{'enableBNR'} ne "on") {
       $FORM{'enableBNR'} = "off";
     }
@@ -204,6 +208,9 @@ sub DisplayPreferences {
       system("$CONFIG{'DSPAM_BIN'}/dspam_admin ch pref '".quotemeta($USER).
         "' statisticalSedation "
         . quotemeta($FORM{'statisticalSedation'}) . " > /dev/null");
+      system("$CONFIG{'DSPAM_BIN'}/dspam_admin ch pref ".quotemeta($USER).
+        " optOutClamAV "
+        . quotemeta($FORM{'optOutClamAV'}) . "> /dev/null");
       system("$CONFIG{'DSPAM_BIN'}/dspam_admin ch pref '".quotemeta($USER).
         "' enableBNR "
         . quotemeta($FORM{'enableBNR'}) . "> /dev/null");
@@ -230,6 +237,7 @@ trainingMode=$FORM{'trainingMode'}
 spamAction=$FORM{'spamAction'}
 spamSubject=$FORM{'spamSubject'}
 statisticalSedation=$FORM{'statisticalSedation'}
+optOutClamAV=$FORM{'optOutClamAV'}
 enableBNR=$FORM{'enableBNR'}
 enableWhitelist=$FORM{'enableWhitelist'}
 signatureLocation=$FORM{'signatureLocation'}
@@ -258,6 +266,10 @@ _END
     $DATA{'C_OPTOUT'} = "CHECKED";
   }
 
+  if ($PREFS{"optOutClamAV"} eq "on") {
+    $DATA{"C_CLAMAV"} = "CHECKED";
+  }
+
   if ($PREFS{"enableBNR"} eq "on") {
     $DATA{"C_BNR"} = "CHECKED";
   }
@@ -307,6 +319,7 @@ sub DisplayUserStatistics {
     }
 
     my(%PREFS) = GetPrefs($username, GetPath($username).".prefs");
+    $PREFS{'optOutClamAV'} = "OFF" if ($PREFS{'optOutClamAV'} ne "on");
     $PREFS{'enableBNR'} = "OFF" if ($PREFS{'enableBNR'} ne "on");
     $PREFS{'enableWhitelist'} = "OFF" if ($PREFS{'enableWhitelist'} ne "on");
     $PREFS{'spamAction'} = ucfirst($PREFS{'spamAction'});
@@ -341,6 +354,7 @@ sub DisplayUserStatistics {
                       "        <td class=\"$b\">$ic</td>".
                       "        <td class=\"$b 
rowDivider\">$PREFS{'trainingMode'}</td>".
                       "        <td class=\"$b\">$PREFS{'spamAction'}</td>".
+                      " <td class=\"$b\">$PREFS{'optOutClamAV'}</td>".
                       "        <td class=\"$b\">$PREFS{'enableBNR'}</td>".
                       "        <td 
class=\"$b\">$PREFS{'enableWhitelist'}</td>".
                       "        <td 
class=\"$b\">$PREFS{'statisticalSedation'}</td>".
@@ -364,6 +378,7 @@ sub DisplayUserStatistics {
                     "  <td class=\"$b\">&nbsp;</td>".
                     "  <td class=\"$b\">&nbsp;</td>".
                     "  <td class=\"$b\">&nbsp;</td>".
+                    "   <td class=\"$b\">&nbsp;</td>".
                     "  <td class=\"$b\">&nbsp;</td>".
                     "  <td class=\"$b\">&nbsp;</td>".
                    "</tr>\n";
-- 
1.6.0.4


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to