Skip to content
This repository
Browse code

CommentSpice, SpamblockBee: Removed antispam related code from CS and

finetuned SB.
  • Loading branch information...
commit 43b7bcaaa36587d42f2f1e7be5fa08f30bc4ff3c 1 parent 385533e
Grischa Brockhaus authored
3  serendipity_event_commentspice/ChangeLog
... ...
@@ -1,3 +1,6 @@
  1
+Version 1.02
  2
+* Removed all antispam related and put it into a new plugin "Spamblock Bee".
  3
+
1 4
 Version 1.01
2 5
 * Preview of a comment is "spiced" now, too.
3 6
 * Preview comment is not loosing article promotion selection anymore.
16  serendipity_event_commentspice/UTF-8/lang_de.inc.php
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 @define('PLUGIN_EVENT_COMMENTSPICE_TITLE', 'Comment Spice');
4  
-@define('PLUGIN_EVENT_COMMENTSPICE_DESC',  'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators. Implementiert auch einige AntiSpam Routinen wie einen "Honeypot" und nofollow nach bestimmten Regeln.');
  4
+@define('PLUGIN_EVENT_COMMENTSPICE_DESC',  'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators und nofollow nach bestimmten Regeln.');
5 5
 
6 6
 @define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_TWITTERNAME', 'Twittername');
7 7
 @define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_ANNOUNC_RSS', 'Artikel bewerben');
@@ -59,20 +59,6 @@
59 59
 
60 60
 @define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugin Pfad');
61 61
 @define('PLUGIN_EVENT_COMMENTSPICE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
62  
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS', 'Pflichtfelder');
63  
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
64  
-@define('PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
65  
-
66  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM', 'Anti Spam');
67  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT', 'Honeypot einsetzen');
68  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC', 'Ein "Honeypot" ist ein verstecktes Kommentar Feld, das leer gelasen werden soll. Da Bots aber dazu tendieren, alle vorgefundenen Felder auszufüllen, ist dies ein einfacher und unkritischer Weg, viele der Bots auszusperren. Um den Honeypot besonders effektiv zu machen, setze CommentSpice als erstes AntiSpam plugin in Deiner Liste ein.');
69  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE', 'Spam Log Typ');
70  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC', 'Wohin sollen Kommentare, die von CommentSpice gefunden wurden, geloggt werden?');
71  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE', 'Nicht loggen');
72  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE', 'Textdatei');
73  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE', 'Spamlog Datenbank Tabelle');
74  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE', 'Logdatei');
75  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC', 'Wohin soll das Textfile für die Logs gespeichert werden?');
76 62
 
77 63
 @define('PLUGIN_EVENT_COMMENTSPICE_EXPERTSETTINGS', 'Erweiterte Einstellungen anzeigen');
78 64
 @define('PLUGIN_EVENT_COMMENTSPICE_STANDARDSETTINGS', 'Grundeinstellungen anzeigen');
16  serendipity_event_commentspice/lang_de.inc.php
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 @define('PLUGIN_EVENT_COMMENTSPICE_TITLE', 'Comment Spice');
4  
-@define('PLUGIN_EVENT_COMMENTSPICE_DESC',  'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators. Implementiert auch einige AntiSpam Routinen wie einen "Honeypot" und nofollow nach bestimmten Regeln.');
  4
+@define('PLUGIN_EVENT_COMMENTSPICE_DESC',  'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators und nofollow nach bestimmten Regeln.');
5 5
 
6 6
 @define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_TWITTERNAME', 'Twittername');
7 7
 @define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_ANNOUNC_RSS', 'Artikel bewerben');
@@ -59,20 +59,6 @@
59 59
 
60 60
 @define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugin Pfad');
61 61
 @define('PLUGIN_EVENT_COMMENTSPICE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
62  
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS', 'Pflichtfelder');
63  
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
64  
-@define('PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
65  
-
66  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM', 'Anti Spam');
67  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT', 'Honeypot einsetzen');
68  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC', 'Ein "Honeypot" ist ein verstecktes Kommentar Feld, das leer gelasen werden soll. Da Bots aber dazu tendieren, alle vorgefundenen Felder auszufüllen, ist dies ein einfacher und unkritischer Weg, viele der Bots auszusperren. Um den Honeypot besonders effektiv zu machen, setze CommentSpice als erstes AntiSpam plugin in Deiner Liste ein.');
69  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE', 'Spam Log Typ');
70  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC', 'Wohin sollen Kommentare, die von CommentSpice gefunden wurden, geloggt werden?');
71  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE', 'Nicht loggen');
72  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE', 'Textdatei');
73  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE', 'Spamlog Datenbank Tabelle');
74  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE', 'Logdatei');
75  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC', 'Wohin soll das Textfile für die Logs gespeichert werden?');
76 62
 
77 63
 @define('PLUGIN_EVENT_COMMENTSPICE_EXPERTSETTINGS', 'Erweiterte Einstellungen anzeigen');
78 64
 @define('PLUGIN_EVENT_COMMENTSPICE_STANDARDSETTINGS', 'Grundeinstellungen anzeigen');
16  serendipity_event_commentspice/lang_en.inc.php
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 @define('PLUGIN_EVENT_COMMENTSPICE_TITLE', 'Comment Spice');
4  
-@define('PLUGIN_EVENT_COMMENTSPICE_DESC',  'Spice up your comments area with goodies like commenters twitter or last posted article link. Has some antispam stuff like a honeypot and nofollows by rules.');
  4
+@define('PLUGIN_EVENT_COMMENTSPICE_DESC',  'Spice up your comments area with goodies like commenters twitter or last posted article link and nofollows by rules.');
5 5
 
6 6
 @define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_TWITTERNAME', 'Twittername');
7 7
 @define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_ANNOUNC_RSS', 'Announce recent posts');
@@ -59,20 +59,6 @@
59 59
 
60 60
 @define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugins path');
61 61
 @define('PLUGIN_EVENT_COMMENTSPICE_PATH_DESC', 'In normal installations the default is correct.');
62  
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS', 'Required comment fields');
63  
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC', 'Enter a list of required fields that need to be filled when a user comments. Seperate multiple fields with a ",". Available keys are: name, email, url, replyTo, comment');
64  
-@define('PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD', 'You did not specify the %s field!');
65  
-
66  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM', 'Anti Spam');
67  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT', 'Use Honeypot');
68  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC', 'A "Honeypot" is a hidden comment form field that should be left empty but as most SPAM bots do fill any field found it is an easy way to detect automatic commenting. There is no risk to switch it on, but high benefit! In order to make the honeypot more effective put CommentSpice at top of any anti spam plugin.');
69  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE', 'Spam log type');
70  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC', 'Where do you want to log spam found by CommentSpice?');
71  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE', 'Don\'t log');
72  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE', 'Text logfile');
73  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE', 'Spamlog database table');
74  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE', 'Logfile');
75  
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC', 'Where to save the logfile if used for logging?');
76 62
 
77 63
 @define('PLUGIN_EVENT_COMMENTSPICE_EXPERTSETTINGS', 'Show advanced settings');
78 64
 @define('PLUGIN_EVENT_COMMENTSPICE_STANDARDSETTINGS', 'Show basic settings');
162  serendipity_event_commentspice/serendipity_event_commentspice.php
@@ -34,7 +34,8 @@ function introspect(&$propbag)
34 34
             'smarty'      => '2.6.7',
35 35
             'php'         => '4.1.0'
36 36
         ));
37  
-        $propbag->add('version',       '1.01');
  37
+        $propbag->add('version',       '1.02');
  38
+
38 39
         $propbag->add('event_hooks',    array(
39 40
             'entry_display' => true,
40 41
             'frontend_footer' => true,
@@ -47,7 +48,7 @@ function introspect(&$propbag)
47 48
             'css'				=> true,
48 49
             'avatar_fetch_userinfos' => true,
49 50
         ));
50  
-        $propbag->add('groups', array('FRONTEND_VIEWS','ANTISPAM'));
  51
+        $propbag->add('groups', array('FRONTEND_VIEWS'));
51 52
         
52 53
         $config_switchexpert = array('expert_switch');
53 54
         $config_twitter = array('title_twitter','twitterinput','followme_widget', 'followme_widget_counter','followme_widget_dark');
@@ -60,13 +61,7 @@ function introspect(&$propbag)
60 61
         
61 62
         $config_boo = array('title_boo','allow_boo','moderate_boo');
62 63
         
63  
-        $config_spam = array('title_spam', 'do_honeypot');
64  
-        $config_spam_expert = array('spamlogtype', 'spamlogfile');
65  
-        
66 64
         $config_general = array('title_general');
67  
-        if (!class_exists('serendipity_event_spamblock')) { // Only do that, if spamblock is not installed.
68  
-            $config_general[] = 'required_fields';
69  
-        }
70 65
         if (function_exists('fetchPingbackData') && $this->isLocalConfigWritable()) {
71 66
             $config_general[] = 'fetchPingback';
72 67
         }
@@ -74,16 +69,16 @@ function introspect(&$propbag)
74 69
         
75 70
         $open_expert_setting = isset($_GET['pluginexpert']);
76 71
         if ($open_expert_setting) {
77  
-            $configuration = array_merge($config_switchexpert,$config_twitter, $config_twitter_expert, $config_announce, $config_announce_expert, $config_boo, $config_rules, $config_rules_extra, $config_spam, $config_spam_expert, $config_general, $config_general_expert);
  72
+            $configuration = array_merge($config_switchexpert,$config_twitter, $config_twitter_expert, $config_announce, $config_announce_expert, $config_boo, $config_rules, $config_rules_extra, $config_general, $config_general_expert);
78 73
         }
79 74
         else {
80  
-            $configuration = array_merge($config_switchexpert,$config_twitter, $config_announce, $config_rules, $config_spam, $config_general);
  75
+            $configuration = array_merge($config_switchexpert,$config_twitter, $config_announce, $config_rules, $config_general);
81 76
         }
82 77
         $propbag->add('configuration', $configuration );
83 78
     }
84 79
 
85 80
     function generate_content(&$title) {
86  
-        $title = PLUGIN_EVENT_EMOTICONCHOOSER_TITLE;
  81
+        $title = PLUGIN_EVENT_COMMENTSPICE_TITLE;
87 82
     }
88 83
 
89 84
     function introspect_config_item($name, &$propbag)
@@ -257,45 +252,10 @@ function introspect_config_item($name, &$propbag)
257 252
                 $propbag->add('default', 0);
258 253
                 break;
259 254
                 
260  
-            case 'title_spam':
261  
-                $propbag->add('type', 'content');
262  
-                $propbag->add('default',   '<br/><h3>' . PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM .'</h3>');
263  
-                break;
264  
-            case 'do_honeypot':
265  
-                $propbag->add('type',        'boolean');
266  
-                $propbag->add('name',        PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT);
267  
-                $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC);
268  
-                $propbag->add('default',     true);
269  
-                break;
270  
-            case 'spamlogtype':
271  
-                $logtypevalues = array (
272  
-                    'none' => PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE,
273  
-                    'file' => PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE,
274  
-                    'db' => PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE,
275  
-                );
276  
-                $propbag->add('type',       'select');
277  
-                $propbag->add('name',        PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE);
278  
-                $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC);
279  
-                $propbag->add('select_values', $logtypevalues);
280  
-                $propbag->add('default',     'none');
281  
-                break;
282  
-            case 'spamlogfile':
283  
-                $propbag->add('type', 'string');
284  
-                $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE);
285  
-                $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC);
286  
-                $propbag->add('default', $serendipity['serendipityPath'] . 'spamblock.log');
287  
-                break;
288  
-                
289 255
             case 'title_general':
290 256
                 $propbag->add('type', 'content');
291 257
                 $propbag->add('default',   '<br/><h3>' . PLUGIN_EVENT_COMMENTSPICE_CONFIG_GENERAL .'</h3>');
292 258
                 break;
293  
-            case 'required_fields':
294  
-                $propbag->add('type', 'string');
295  
-                $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS);
296  
-                $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC);
297  
-                $propbag->add('default', '');
298  
-                break;
299 259
             case 'plugin_path':
300 260
                 $propbag->add('type', 'string');
301 261
                 $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_PATH);
@@ -569,32 +529,7 @@ function checkComment(&$eventData, &$addData) {
569 529
         
570 530
         if ("NORMAL" == $addData['type']) { // only supported for normal comments
571 531
             $this->rememberInputs();
572  
-            // Check for honeypot:
573  
-            $do_honepot = serendipity_db_bool($this->get_config('do_honeypot',true));
574  
-            if ($do_honepot && (!empty($serendipity['POST']['phone']) || $serendipity['POST']['phone']=='0') ) {
575  
-                $logfile = $this->get_config('spamlogfile', $serendipity['serendipityPath'] . 'spamblock.log');
576  
-                $this->spamlog($logfile, $eventData['id'], 'REJECTED', $serendipity['POST']['phone'], $addData);
577  
-                $eventData = array('allow_comments' => false);
578  
-                return false;
579  
-            }
580  
-            
581  
-            // Check, if all required fields are set, but only if spamblock is not installed.
582  
-            if (!class_exists('serendipity_event_spamblock')) {
583  
-                $required_fields = $this->get_config('required_fields', '');
584  
-                if (!empty($required_fields)) {
585  
-                    $required_field_list = explode(',', $required_fields);
586  
-                    foreach($required_field_list as $required_field) {
587  
-                        $required_field = trim($required_field);
588  
-                        if (empty($addData[$required_field])) {
589  
-                            $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD, $addData);
590  
-                            $eventData = array('allow_comments' => false);
591  
-                            $serendipity['messagestack']['comments'][] = sprintf(PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD, $required_field);
592  
-                            return false;
593  
-                        }
594  
-                    }
595  
-                }
596  
-            }
597  
-            
  532
+
598 533
             // Check, if promoted URL is still valid (unmodified) 
599 534
             if (isset($serendipity['POST']['promorss']) && !empty($serendipity['POST']['promorss'])) {
600 535
                 $promorss = $serendipity['POST']['promorss'];
@@ -942,15 +877,6 @@ function printCommentEditExtras(&$eventData, &$addData) {
942 877
         $styleInputRss = serendipity_db_bool($this->get_config('style_inputrss',true));
943 878
         
944 879
 
945  
-        // Honeypot
946  
-        if (serendipity_db_bool($this->get_config('do_honeypot',true))) {
947  
-            echo '<div id="serendipity_commentspice_phone" class="serendipity_commentDirection commentspice_phone_input" >' . "\n";
948  
-            echo '<img src="' . $serendipity['baseURL'] . 'index.php?/plugin/commentspice.png" class="commentspice_ico" title="' . PLUGIN_EVENT_COMMENTSPICE_TITLE . '">' . "\n";
949  
-            echo '<label for="serendipity_commentform_phone">Phone*</label>' . "\n";
950  
-            echo '<input class="commentspice_phone_input" type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="" placeholder="You don\'t want to give me your number, do you? ;)"/>' . "\n";
951  
-            echo "</div>\n";
952  
-        }
953  
-        
954 880
         if ($do_twitter) {
955 881
             if (isset($serendipity['COOKIE']['remember']) && isset($serendipity['COOKIE']['twitter'])) {
956 882
                 $twittername = $serendipity['COOKIE']['twitter'];
@@ -1081,15 +1007,6 @@ function printCss(&$eventData, &$addData) {
1081 1007
 }
1082 1008
 <?php
1083 1009
         }
1084  
-        if (!(strpos($eventData, '.commentspice_phone_input'))) {
1085  
-?>
1086  
-.commentspice_phone_input {
1087  
-	max-width: 100%;
1088  
-	display:none;
1089  
-	visibility:hidden;
1090  
-}
1091  
-<?php
1092  
-        }
1093 1010
         if (!(strpos($eventData, '.commentspice_twitter_input'))) {
1094 1011
 ?>
1095 1012
 .commentspice_twitter_input {
@@ -1189,69 +1106,4 @@ function log($message){
1189 1106
         fflush($fp);
1190 1107
         fclose($fp);
1191 1108
     }
1192  
-    
1193  
-	function spamlog($logfile, $id, $switch, $reason, $addData) {
1194  
-        global $serendipity;
1195  
-        $method = $this->get_config('spamlogtype', 'none');
1196  
-        if (empty($logfile)) $logfile = dirname(__FILE__) . '/spice_honeypot.log';
1197  
-        
1198  
-        switch($method) {
1199  
-            case 'file':
1200  
-            	$reason = "Honeypot=$reason";
1201  
-                if (empty($logfile)) {
1202  
-                    return;
1203  
-                }
1204  
-				if (strpos($logfile, '%') !== false) {
1205  
-					$logfile = strftime($logfile);
1206  
-				}
1207  
-
1208  
-                $fp = @fopen($logfile, 'a+');
1209  
-                if (!is_resource($fp)) {
1210  
-                    return;
1211  
-                }
1212  
-                fwrite($fp, sprintf(
1213  
-                    '[%s] - [%s: %s] - [#%s, Name "%s", E-Mail "%s", URL "%s", User-Agent "%s", IP %s] - [%s]' . "\n",
1214  
-                    date('Y-m-d H:i:s', serendipity_serverOffsetHour()),
1215  
-                    $switch,
1216  
-                    $reason,
1217  
-                    $id,
1218  
-                    str_replace("\n", ' ', $addData['name']),
1219  
-                    str_replace("\n", ' ', $addData['email']),
1220  
-                    str_replace("\n", ' ', $addData['url']),
1221  
-                    str_replace("\n", ' ', $_SERVER['HTTP_USER_AGENT']),
1222  
-                    $_SERVER['REMOTE_ADDR'],
1223  
-                    str_replace("\n", ' ', $addData['comment'])
1224  
-                ));
1225  
-
1226  
-                fclose($fp);
1227  
-                break;
1228  
-
1229  
-            case 'none':
1230  
-                return;
1231  
-                break;
1232  
-
1233  
-            case 'db':
1234  
-            default:
1235  
-                $reason = "CommentSpice Honeypot: " . serendipity_db_escape_string($reason);
1236  
-                $q = sprintf("INSERT INTO {$serendipity['dbPrefix']}spamblocklog
1237  
-                                          (timestamp, type, reason, entry_id, author, email, url,  useragent, ip,   referer, body)
1238  
-                                   VALUES (%d,        '%s',  '%s',  '%s',     '%s',   '%s',  '%s', '%s',      '%s', '%s',    '%s')",
1239  
-
1240  
-                           serendipity_serverOffsetHour(),
1241  
-                           serendipity_db_escape_string($switch),
1242  
-                           serendipity_db_escape_string($reason),
1243  
-                           serendipity_db_escape_string($id),
1244  
-                           serendipity_db_escape_string($addData['name']),
1245  
-                           serendipity_db_escape_string($addData['email']),
1246  
-                           serendipity_db_escape_string($addData['url']),
1247  
-                           substr(serendipity_db_escape_string($_SERVER['HTTP_USER_AGENT']), 0, 255),
1248  
-                           serendipity_db_escape_string($_SERVER['REMOTE_ADDR']),
1249  
-                           substr(serendipity_db_escape_string(isset($_SESSION['HTTP_REFERER']) ? $_SESSION['HTTP_REFERER'] : $_SERVER['HTTP_REFERER']), 0, 255),
1250  
-                           serendipity_db_escape_string($addData['comment'])
1251  
-                );
1252  
-
1253  
-                serendipity_db_schema_import($q);
1254  
-                break;
1255  
-        }
1256  
-    }    
1257 1109
 }
7  serendipity_event_spamblock_bee/UTF-8/lang_de.inc.php
... ...
@@ -1,11 +1,12 @@
1 1
 <?php
2 2
 
3  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honepot)');
4  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC',  'Implementiert einfache Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind. (Honeypot)');
  3
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honeypot)');
  4
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC',  'Implementiert Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind (Honeypot).');
  5
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC',  '<strong>Installationshinweis</strong>: Es ist recht wichtig, dieses Plugin an die Spitze Deiner Plugin Liste zu verschieben, weil es dann am effektivsten arbeiten kann.');
5 6
 
6 7
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH', 'Plugin Pfad');
7 8
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
8  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder');
  9
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder beim Kommentieren');
9 10
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
10 11
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
11 12
 
7  serendipity_event_spamblock_bee/lang_de.inc.php
... ...
@@ -1,11 +1,12 @@
1 1
 <?php
2 2
 
3  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honepot)');
4  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC',  'Implementiert einfache Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind. (Honeypot)');
  3
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honeypot)');
  4
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC',  'Implementiert Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind (Honeypot).');
  5
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC',  '<strong>Installationshinweis</strong>: Es ist recht wichtig, dieses Plugin an die Spitze Deiner Plugin Liste zu verschieben, weil es dann am effektivsten arbeiten kann.');
5 6
 
6 7
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH', 'Plugin Pfad');
7 8
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
8  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder');
  9
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder beim Kommentieren');
9 10
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
10 11
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
11 12
 
7  serendipity_event_spamblock_bee/lang_en.inc.php
... ...
@@ -1,11 +1,12 @@
1 1
 <?php
2 2
 
3  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamblock Bee (Honepot)');
4  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC',  'Implements simple comment antispam mechanisms, that are easy to configure but very effective (Honepot).');
  3
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamblock Bee (Honeypot)');
  4
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC',  'Implements simple comment antispam mechanisms, that are easy to configure but very effective (Honeypot).');
  5
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC',  '<strong>Installation hint</strong>: It is important that you put this plugin at the start of your plugin list. It will be most effective then.');
5 6
 
6 7
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH', 'Plugins path');
7 8
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC', 'In normal installations the default is correct.');
8  
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Required comment fields');
  9
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Required comment fields when commenting');
9 10
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC', 'Enter a list of required fields that need to be filled when a user comments. Seperate multiple fields with a ",". Available keys are: name, email, url, replyTo, comment');
10 11
 @define('PLUGIN_EVENT_SPAMBLOCK_BEE_REASON_REQUIRED_FIELD', 'You did not specify the %s field!');
11 12
 
31  serendipity_event_spamblock_bee/serendipity_event_spamblock_bee.php
@@ -40,7 +40,11 @@ function introspect(&$propbag)
40 40
         ));
41 41
         $propbag->add('groups', array('ANTISPAM'));
42 42
         
43  
-        $configuration = array('do_honeypot', 'spamlogtype', 'spamlogfile', 'plugin_path');
  43
+        $configuration = array('header_desc','do_honeypot', 'spamlogtype', 'spamlogfile', );
  44
+        if (!class_exists('serendipity_event_spamblock')) { // Only do that, if spamblock is not installed.
  45
+            $configuration[] = 'required_fields';
  46
+        }
  47
+        $configuration[] = 'plugin_path';
44 48
         
45 49
         $propbag->add('configuration', $configuration );
46 50
     }
@@ -54,6 +58,11 @@ function introspect_config_item($name, &$propbag)
54 58
         global $serendipity;
55 59
         
56 60
         switch($name) {
  61
+            case 'header_desc': 
  62
+                $propbag->add('type', 'content');
  63
+                $propbag->add('default',   PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC);
  64
+                break;
  65
+                break;
57 66
             case 'do_honeypot':
58 67
                 $propbag->add('type',        'boolean');
59 68
                 $propbag->add('name',        PLUGIN_EVENT_SPAMBLOCK_BEE_CONFIG_SPAM_HONEYPOT);
@@ -80,8 +89,8 @@ function introspect_config_item($name, &$propbag)
80 89
                 break;
81 90
             case 'required_fields':
82 91
                 $propbag->add('type', 'string');
83  
-                $propbag->add('name', PLUGIN_EVENT_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS);
84  
-                $propbag->add('description', PLUGIN_EVENT_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC);
  92
+                $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS);
  93
+                $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC);
85 94
                 $propbag->add('default', '');
86 95
                 break;
87 96
                 
@@ -89,7 +98,7 @@ function introspect_config_item($name, &$propbag)
89 98
                 $propbag->add('type', 'string');
90 99
                 $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BEE_PATH);
91 100
                 $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC);
92  
-                $propbag->add('default', $serendipity['serendipityHTTPPath'] . 'plugins/serendipity_event_commentspice/');
  101
+                $propbag->add('default', $serendipity['serendipityHTTPPath'] . 'plugins/serendipity_event_spamblock_bee/');
93 102
                 break;
94 103
 
95 104
             default:
@@ -169,9 +178,9 @@ function printCommentEditExtras(&$eventData, &$addData) {
169 178
         
170 179
         // Honeypot
171 180
         if (serendipity_db_bool($this->get_config('do_honeypot',true))) {
172  
-            echo '<div id="serendipity_commentspice_phone" class="serendipity_commentDirection commentspice_phone_input" >' . "\n";
  181
+            echo '<div id="serendipity_comment_phone" class="serendipity_commentDirection comment_phone_input" >' . "\n";
173 182
             echo '<label for="serendipity_commentform_phone">Phone*</label>' . "\n";
174  
-            echo '<input class="commentspice_phone_input" type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="" placeholder="You don\'t want to give me your number, do you? ;)"/>' . "\n";
  183
+            echo '<input class="comment_phone_input" type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="" placeholder="You don\'t want to give me your number, do you? ;)"/>' . "\n";
175 184
             echo "</div>\n";
176 185
         }
177 186
     }
@@ -179,13 +188,15 @@ function printCommentEditExtras(&$eventData, &$addData) {
179 188
     function printCss(&$eventData, &$addData) {
180 189
         global $serendipity;
181 190
 
182  
-        if (!(strpos($eventData, '.commentspice_phone_input'))) {
  191
+        if (!(strpos($eventData, '.comment_phone_input'))) {
183 192
 ?>
184  
-.commentspice_phone_input {
  193
+.comment_phone_input {
185 194
 	max-width: 100%;
  195
+}
  196
+/*
186 197
 	display:none;
187 198
 	visibility:hidden;
188  
-}
  199
+*/
189 200
 <?php
190 201
         }
191 202
     }
@@ -201,7 +212,7 @@ function hashString( $what ) {
201 212
     
202 213
     function log($message){
203 214
         if (!PLUGIN_EVENT_SPAMBLOCK_BEE_DEBUG) return;
204  
-        $fp = fopen(dirname(__FILE__) . '/spice.log','a');
  215
+        $fp = fopen(dirname(__FILE__) . '/spambee.log','a');
205 216
         fwrite($fp, date('Y.m.d H:i:s') . " - " . $message . "\n");
206 217
         fflush($fp);
207 218
         fclose($fp);

0 notes on commit 43b7bca

Please sign in to comment.
Something went wrong with that request. Please try again.