Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8409/plugins/serendipity_event_spamblock
Modified Files:
serendipity_event_spamblock.php
Log Message:
Trackback moderation support in admin panel, make captcha plugin only work for comments (garvinhicking)
Index: serendipity_event_spamblock.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- serendipity_event_spamblock.php 7 Oct 2004 08:18:20 -0000 1.23
+++ serendipity_event_spamblock.php 7 Oct 2004 10:31:22 -0000 1.24
@@ -230,7 +230,7 @@
$hooks = &$bag->get('event_hooks');
- if (isset($hooks[$event]) && @$_REQUEST['type'] != 'trackback' && @$_REQUEST['type'] != 'pingback') {
+ if (isset($hooks[$event])) {
$captchas_ttl = $this->get_config('captchas_ttl', 7);
$captchas = (serendipity_db_bool($this->get_config('captchas', true)) ? true : false);
// Check if the entry is older than the allowed amount of time. Enforce kaptchas if that is true
@@ -276,7 +276,7 @@
}
// Check last IP
- if ( $this->get_config('ipflood', 2) != 0 ) {
+ if ($addData['type'] == 'NORMAL' && $this->get_config('ipflood', 2) != 0 ) {
$query = "SELECT max(timestamp) AS last_post FROM {$serendipity['dbPrefix']}comments WHERE ip = '" . serendipity_db_escape_string($_SERVER['REMOTE_ADDR']) . "'";
$row = serendipity_db_query($query, true);
if (is_array($row) && $row['last_post'] > (time() - $this->get_config('ipflood', 2)*60)) {
@@ -310,7 +310,7 @@
}
// Captcha checking
- if ($show_captcha) {
+ if ($show_captcha && $addData['type'] == 'NORMAL') {
if (!isset($_SESSION['spamblock']['captcha']) || !isset($serendipity['POST']['captcha']) || strtolower($serendipity['POST']['captcha']) != strtolower($_SESSION['spamblock']['captcha'])) {
$this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_REASON_CAPTCHAS, $addData);
$eventData = array('allow_comments' => false);
@@ -513,4 +513,4 @@
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
+?>
\ No newline at end of file
|