[geeklog-hg] geeklog: Record types to delete for Spam-X plugin now are config...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Feb 2 10:47:12 EST 2014


changeset 9467:29536cd66f97
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/29536cd66f97
user: Tom <websitemaster at cogeco.net>
date: Sun Feb 02 10:24:29 2014 -0500
description:
Record types to delete for Spam-X plugin now are configurable.

diffstat:

 plugins/spamx/functions.inc              |  17 +++++++++++++++--
 plugins/spamx/install_defaults.php       |   3 ++-
 plugins/spamx/install_updates.php        |   3 ++-
 plugins/spamx/language/english.php       |   1 +
 plugins/spamx/language/english_utf-8.php |   3 ++-
 public_html/docs/english/spamx.html      |  14 +++++++++++++-
 public_html/docs/japanese/spamx.html     |  14 +++++++++++++-
 7 files changed, 48 insertions(+), 7 deletions(-)

diffs (128 lines):

diff -r 1104eee5695b -r 29536cd66f97 plugins/spamx/functions.inc
--- a/plugins/spamx/functions.inc	Sat Feb 01 17:47:28 2014 -0500
+++ b/plugins/spamx/functions.inc	Sun Feb 02 10:24:29 2014 -0500
@@ -380,11 +380,24 @@
     }
 
     // Clear out any old records
-    if ($_SPX_CONF['max_age'] > 1) {
+    $deletelist = '';
+    if (is_array($_SPX_CONF['records_delete'])) {
+        foreach ($_SPX_CONF['records_delete'] as $record) {
+            if (!empty($record)) {
+                $record = DB_escapeString($record);
+                if ($deletelist == '') {
+                    $deletelist = "'$record'";
+                } else {
+                    $deletelist .= ", '$record'";
+                }
+            }
+        }
+    }
+    if ($_SPX_CONF['max_age'] > 1 && $deletelist != '') {
         $timestamp = DB_escapeString(date('Y-m-d'));
         $sql = "DELETE FROM {$_TABLES['spamx']} 
             WHERE DATE_ADD(regdate,INTERVAL {$_SPX_CONF['max_age']} DAY) < '$timestamp' 
-            AND name <> 'SLVwhitelist'";
+            AND name IN ($deletelist)";
         DB_query($sql);        
     }
 
diff -r 1104eee5695b -r 29536cd66f97 plugins/spamx/install_defaults.php
--- a/plugins/spamx/install_defaults.php	Sat Feb 01 17:47:28 2014 -0500
+++ b/plugins/spamx/install_defaults.php	Sun Feb 02 10:24:29 2014 -0500
@@ -122,7 +122,8 @@
         $c->add('spamx_action', $_SPX_DEFAULT['action'], 'text',
                 0, 0, null, 50, false, 'spamx', 0);
         $c->add('max_age', $_SPX_DEFAULT['max_age'], 'text',
-                        0, 0, null, 60, true, 'spamx', 0);        
+                        0, 0, null, 60, true, 'spamx', 0);
+        $c->add('records_delete', array('email','IP'), '%text', 0, 0, NULL, 70, TRUE, 'spamx', 0);        
 
         $c->add('tab_modules', NULL, 'tab', 0, 0, NULL, 0, true, 'spamx', 10);
         $c->add('fs_sfs', NULL, 'fieldset', 0, 0, NULL, 0, true, 'spamx', 10);
diff -r 1104eee5695b -r 29536cd66f97 plugins/spamx/install_updates.php
--- a/plugins/spamx/install_updates.php	Sat Feb 01 17:47:28 2014 -0500
+++ b/plugins/spamx/install_updates.php	Sun Feb 02 10:24:29 2014 -0500
@@ -54,7 +54,8 @@
     $c->add('max_age', $_SPX_DEFAULT['max_age'], 'text',
                     0, 0, null, 60, true, 'spamx', 0);  
     $c->add('sfs_confidence', $_SPX_DEFAULT['sfs_confidence'], 'text',
-                    0, 0, null, 20, true, 'spamx', 10);      
+                    0, 0, null, 20, true, 'spamx', 10); 
+    $c->add('records_delete', array('email','IP'), '%text', 0, 0, NULL, 70, TRUE, 'spamx', 0);
 
     return true;
 }
diff -r 1104eee5695b -r 29536cd66f97 plugins/spamx/language/english.php
--- a/plugins/spamx/language/english.php	Sat Feb 01 17:47:28 2014 -0500
+++ b/plugins/spamx/language/english.php	Sun Feb 02 10:24:29 2014 -0500
@@ -166,6 +166,7 @@
     'logging' => 'Enable Logging',
     'timeout' => 'Timeout', 
     'max_age' => 'Max Age of Records',
+    'records_delete' => 'Record Types to Delete',
     'sfs_enabled' => 'Enable SFS',
     'sfs_confidence' => 'Confidence Threshold',
     'snl_enabled' => 'Enable SNL',
diff -r 1104eee5695b -r 29536cd66f97 plugins/spamx/language/english_utf-8.php
--- a/plugins/spamx/language/english_utf-8.php	Sat Feb 01 17:47:28 2014 -0500
+++ b/plugins/spamx/language/english_utf-8.php	Sun Feb 02 10:24:29 2014 -0500
@@ -165,7 +165,8 @@
     'notification_email' => 'Notification Email',
     'logging' => 'Enable Logging',
     'timeout' => 'Timeout',
-    'max_age' => 'Max Age of Records', 
+    'max_age' => 'Max Age of Records',
+    'records_delete' => 'Record Types to Delete',
     'sfs_enabled' => 'Enable SFS',
     'sfs_confidence' => 'Confidence Threshold',
     'snl_enabled' => 'Enable SNL',
diff -r 1104eee5695b -r 29536cd66f97 public_html/docs/english/spamx.html
--- a/public_html/docs/english/spamx.html	Sat Feb 01 17:47:28 2014 -0500
+++ b/public_html/docs/english/spamx.html	Sun Feb 02 10:24:29 2014 -0500
@@ -307,7 +307,19 @@
 <tr>
   <td><a name="desc_max_age">max_age</a></td>
   <td>0</td>
-  <td>The max age in days to keep spamx records since there last update (0 = infinite). SLV Whitelist records will not be deleted.</td>
+  <td>The max age in days to keep Spam-X records since there last update (0 = infinite). SLV Whitelist records will not be deleted.</td>
+</tr>
+<tr>
+  <td><a name="desc_records_delete">records_delete</a></td>
+  <td><code>'email', 'IP'</code></td>
+  <td>The Spam-X record types to delete when max age is reached. Default types include:<ul>
+    <li>Personal Blacklist = 'Personal'</li>
+    <li>HTTP Header Blacklist = 'HTTPHeader'</li>
+    <li>IP Blacklist = 'IP'</li>
+    <li>IP of URL Blacklist = 'IPofUrl'</li>
+    <li>SFS Email Blacklist = 'email'</li>
+    <li>SLV Whitelist = 'SLVwhitelist'</li>
+  </ul></td>
 </tr>
 </table>
 
diff -r 1104eee5695b -r 29536cd66f97 public_html/docs/japanese/spamx.html
--- a/public_html/docs/japanese/spamx.html	Sat Feb 01 17:47:28 2014 -0500
+++ b/public_html/docs/japanese/spamx.html	Sun Feb 02 10:24:29 2014 -0500
@@ -194,7 +194,19 @@
 <tr>
   <td><a name="desc_max_age">max_age</a></td>
   <td>0</td>
-  <td>The max age in days to keep spamx records since there last update (0 = infinite). SLV Whitelist records will not be deleted.</td>
+  <td>The max age in days to keep Spam-X records since there last update (0 = infinite). SLV Whitelist records will not be deleted.</td>
+</tr>
+<tr>
+  <td><a name="desc_records_delete">records_delete</a></td>
+  <td><code>'email', 'IP'</code></td>
+  <td>The Spam-X record types to delete when max age is reached. Default types include:<ul>
+    <li>Personal Blacklist = 'Personal'</li>
+    <li>HTTP Header Blacklist = 'HTTPHeader'</li>
+    <li>IP Blacklist = 'IP'</li>
+    <li>IP of URL Blacklist = 'IPofUrl'</li>
+    <li>SFS Email Blacklist = 'email'</li>
+    <li>SLV Whitelist = 'SLVwhitelist'</li>
+  </ul></td>
 </tr>
 </table>
 



More information about the geeklog-cvs mailing list