Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18260/plugins/serendipity_event_spamblock
Modified Files:
Tag: branch-smarty
serendipity_event_spamblock.php
Removed Files:
Tag: branch-smarty
Comic_Sans_MS.ttf
Log Message:
* Do not use RBLs by default
* Do not perform IP-restriction by default
* Jump to notification area after comment submission
* If moderation is performed, we should display that to the user
Index: serendipity_event_spamblock.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php,v
retrieving revision 1.4.2.15
retrieving revision 1.4.2.16
diff -u -d -r1.4.2.15 -r1.4.2.16
--- serendipity_event_spamblock.php 27 Sep 2004 09:12:29 -0000 1.4.2.15
+++ serendipity_event_spamblock.php 27 Sep 2004 12:13:50 -0000 1.4.2.16
@@ -14,8 +14,10 @@
@define('PLUGIN_EVENT_SPAMBLOCK_KILLSWITCH_DESC', 'Übergangsweise Kommentare zu allen Einträgen verbieten. Nützlich, wenn das Blog unter andauerndem Spam-Beschuss leidet.');
@define('PLUGIN_EVENT_SPAMBLOCK_IPFLOOD', 'IP-Block Intervall');
@define('PLUGIN_EVENT_SPAMBLOCK_IPFLOOD_DESC', 'Schränkt die Anzahl an Kommentare pro IP ein, indem nur alle X Minuten ein Kommentar erlaubt wird. Hilfreich um Spamfluten derselben IP abzuwehren.');
- @define('PLUGIN_EVENT_SPAMBLOCK_RBL', 'Kommentare von RBL-Block comments from RBL-listed hosts');
- @define('PLUGIN_EVENT_SPAMBLOCK_RBL_DESC', 'Kommentare von Personen, deren IP in einer RBL (Blacklist) geführt wird, werden verboten. Führen Sie hier die Namen der RBLs auf; Listen mit dynamischen Hosts sollten vermieden werden.');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBL', 'Kommentare abweisen, die von geblacklisteten IPs stammen');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBL_DESC', 'Wird diese Option aktiviert, werden Kommentare abgewiesen die von IPs stammen, die in einer RBL/Blacklist geführt werden. Die Aktivierung hiervon kann Dial-Up oder Proxy-User betreffen!');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBLLIST', 'Welche RBLs sollen verwendet werden');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBLLIST_DESC', 'Eine Liste von zu verwendenden RBLs. Listen mit dynamischen Hosts sollten vermieden werden.');
@define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS', 'Captchas aktivieren');
@define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS_DESC', 'Erfordert die Eingabe eines zufälligen Buchstabenfolge vom Benutzer, damit ein Kommentar angenommen wird. Diese Eingabe kann von Spambots nicht getätigt werden und verhindert so automatische Kommentare. Jedoch können behinderte oder blinde Personen mit der Darstellung solcher Eingabegrafiken Probleme haben.');
@define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS_USERDESC', 'Um maschinelle und automatische Übertragung von Spamkommentaren zu verhinden, bitte die Zeichenfolge im dargestellten Bild in der Eingabemaske eintragen. Nur wenn die Zeichenfolge richtig eingegeben wurde, kann der Kommentar angenommen werden: ');
@@ -55,8 +57,10 @@
@define('PLUGIN_EVENT_SPAMBLOCK_KILLSWITCH_DESC', 'Temporarily disable comments for all entries. Useful if your blog is under spam attack.');
@define('PLUGIN_EVENT_SPAMBLOCK_IPFLOOD', 'IP block interval');
@define('PLUGIN_EVENT_SPAMBLOCK_IPFLOOD_DESC', 'Only allow an IP to submit a comment every n minutes. Useful to prevent comment floods.');
- @define('PLUGIN_EVENT_SPAMBLOCK_RBL', 'Block comments from RBL-listed hosts');
- @define('PLUGIN_EVENT_SPAMBLOCK_RBL_DESC', 'Blocks comments based on provided RBL lists. Avoid lists with dynamic hosts.');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBL', 'Reject comments from RBL-listed hosts');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBL_DESC', 'Enabling this setting will reject comments made from hosts which are listed in RBLs. Pay attention that this may affect proxy-users or dial-up users.');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBLLIST', 'Which RBLs should be contacted');
+ @define('PLUGIN_EVENT_SPAMBLOCK_RBLLIST_DESC', 'Blocks comments based on provided RBL lists. Avoid lists with dynamic hosts.');
@define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS', 'Enable Captchas');
@define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS_DESC', 'Will force the user to input a random string displayed in a specially crafted image. This will disallow automatted submits to your blog. Please remember that people with decreased vision may find it hard to read those captchas.');
@define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS_USERDESC', 'To prevent automatted Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Only if the strings match, your comment will be submitted: ');
@@ -98,7 +102,7 @@
'external_plugin' => true,
'frontend_comment' => true
));
- $propbag->add('configuration', array('killswitch', 'bodyclone', 'ipflood', 'rbl', 'captchas', 'captchas_ttl', 'captcha_color', 'forcemoderation', 'links_moderate', 'links_reject', 'logfile'));
+ $propbag->add('configuration', array('killswitch', 'bodyclone', 'ipflood', 'rbl_enabled', 'rbllist', 'captchas', 'captchas_ttl', 'captcha_color', 'forcemoderation', 'links_moderate', 'links_reject', 'logfile'));
}
function introspect_config_item($name, &$propbag)
@@ -138,13 +142,20 @@
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_IPFLOOD);
$propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_IPFLOOD_DESC);
- $propbag->add('default', 2);
+ $propbag->add('default', 0);
break;
- case 'rbl':
- $propbag->add('type', 'string');
+ case 'rbl_enabled':
+ $propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_RBL);
$propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_RBL_DESC);
+ $propbag->add('default', false);
+ break;
+
+ case 'rbllist':
+ $propbag->add('type', 'string');
+ $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_RBLLIST);
+ $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_RBLLIST_DESC);
$propbag->add('default', 'sbl-xbl.spamhaus.org, bl.spamcop.net');
break;
@@ -223,6 +234,7 @@
switch($event) {
case 'frontend_saveComment':
if (!is_array($eventData) || serendipity_db_bool($eventData['allow_comments'])) {
+ $serendipity['csuccess'] = 'true';
$logfile = $this->get_config('logfile', $serendipity['serendipityPath'] . 'spamblock_captcha.log');
if ( $this->get_config('killswitch', false) === true ) {
$this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_KILLSWITCH, $addData);
@@ -257,11 +269,11 @@
// Check for IP listed in RBL
// Partly based on work done by James Seward (ja...@ja...)
- if ( $this->get_config('rbl') != '' ) {
+ if (serendipity_db_bool($this->get_config('rbl_enabled', false))) {
$remoteIP = $_SERVER['REMOTE_ADDR'];
# $remoteIP = '81.70.69.193';
- $rbls = explode(',', $this->get_config('rbl'));
+ $rbls = explode(',', $this->get_config('rbllist'));
if (preg_match("/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/", $remoteIP, $res)) {
array_shift($res);
$reverseIP = implode('.', array_reverse($res));
@@ -291,7 +303,7 @@
if ($forcemoderation > 0 && $eventData['timestamp'] < (time() - ($forcemoderation * 60 * 60 * 24))) {
$this->log($logfile, $eventData['id'], 'MODERATE', PLUGIN_EVENT_SPAMBLOCK_FORCEMODERATION, $addData);
$eventData['moderate_comments'] = true;
- $serendipity['messagestack']['comments'][] = PLUGIN_EVENT_SPAMBLOCK_NOTICE_MODERATION;
+ $serendipity['csuccess'] = 'moderate';
return false;
}
@@ -306,7 +318,7 @@
if ($links_moderate > 0 && $link_count > $links_moderate) {
$this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_LINKS_MODERATE, $addData);
$eventData['moderate_comments'] = true;
- $serendipity['messagestack']['comments'][] = PLUGIN_EVENT_SPAMBLOCK_NOTICE_MODERATION;
+ $serendipity['csuccess'] = 'moderate';
return false;
}
}
--- Comic_Sans_MS.ttf DELETED ---
|