From 0cec708f2da14912607760a85bb3d7fd8cee2597 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Mon, 19 Jan 2009 11:57:03 +0000 Subject: [PATCH] Document changes in spamblock plugin --- docs/NEWS | 7 ++++ .../lang_de.inc.php | 7 ++++ .../lang_en.inc.php | 11 +++--- .../serendipity_event_spamblock.php | 36 +++++++++++++------ 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 4867091b..de691b4a 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,13 @@ Version 1.5 () ------------------------------------------------------------------------ + * Allow anonymized submission to Typepad/Akismet to attribute + possible federal laws for data protection (garvinhicking) + (RFE #2517320) + + * Change antispam plugin to also support Typepad as an alternative + to Akismet. (judebert) + Version 1.4.1 (January 16th, 2009) ------------------------------------------------------------------------ diff --git a/plugins/serendipity_event_spamblock/lang_de.inc.php b/plugins/serendipity_event_spamblock/lang_de.inc.php index 917d1f2f..895625e7 100644 --- a/plugins/serendipity_event_spamblock/lang_de.inc.php +++ b/plugins/serendipity_event_spamblock/lang_de.inc.php @@ -121,3 +121,10 @@ @define('PLUGIN_EVENT_SPAMBLOCK_CHECKMAIL_VERIFICATION_ALWAYS', 'Immer bestätigen'); @define('PLUGIN_EVENT_SPAMBLOCK_CHECKMAIL_VERIFICATION_MAIL', 'Sie erhalten nun eine E-Mail-Benachrichtigung, mit der Sie ihren Kommentar freischalten können.'); @define('PLUGIN_EVENT_SPAMBLOCK_CHECKMAIL_VERIFICATION_INFO', 'Um einen Kommentar hinterlassen zu können, erhalten Sie nach dem Kommentieren eine E-Mail mit Aktivierungslink an ihre angegebene Adresse.'); + +@define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_SERVER', 'Antispam-Server'); +@define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_SERVER_DESC', 'Für welchen Antispam-Server soll obiger API-Key gelten? Die anonymisierten Varianten bedeuten, dass alle übertragenen Daten zu den Antispam-Servern keine Angabe von Name oder E-Mail-Adresse enthalten. Dies reduziert jedoch auch die Spam-Erkennungsrate.'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS', 'TypePad Antispam'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET', 'Akismet'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS_ANON', 'TypePad Antispam (anonymisiert)'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET_ANON', 'Akismet (anonymisiert)'); diff --git a/plugins/serendipity_event_spamblock/lang_en.inc.php b/plugins/serendipity_event_spamblock/lang_en.inc.php index f9291083..7ba8a005 100644 --- a/plugins/serendipity_event_spamblock/lang_en.inc.php +++ b/plugins/serendipity_event_spamblock/lang_en.inc.php @@ -105,10 +105,6 @@ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE', 'Disable spamblock for Authors'); @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_DESC', 'You can allow authors in the following usergroups to post comments without them being checked by the spamblock plugin.'); -@define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_SERVER', 'Akismet server'); -@define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_SERVER_DESC', 'Which server is the above key registered for?'); -@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS', 'TypePad Antispam'); -@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET', 'Original Akismet'); @define('PLUGIN_EVENT_SPAMBLOCK_AKISMET', 'Akismet API Key'); @define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_DESC', 'Akismet is an anti-spam and blacklisting protocol. It can analyze your incoming comments and check if that comment has been listed as Spam. Two servers are supported: the original Akismet server, and the TypePad Antispam (TPAS) Open Source server. To use the Akismet server, you must register for an account at http://www.wordpress.com/. To use the TPAS server, you must optain a free key from http://antispam.typepad.com/. If you leave the key blank, Akismet will not be used to check spam.'); @define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_FILTER', 'How to treat Akismet-reported spam'); @@ -137,3 +133,10 @@ @define('PLUGIN_EVENT_SPAMBLOCK_CHECKMAIL_VERIFICATION_ALWAYS', 'Confirm always'); @define('PLUGIN_EVENT_SPAMBLOCK_CHECKMAIL_VERIFICATION_MAIL', 'You will now receive an email notification with which you can approve your comment.'); @define('PLUGIN_EVENT_SPAMBLOCK_CHECKMAIL_VERIFICATION_INFO', 'To leave a comment you must approve it via e-mail, which will be sent to your address after submission.'); + +@define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_SERVER', 'Anti-spam server'); +@define('PLUGIN_EVENT_SPAMBLOCK_AKISMET_SERVER_DESC', 'Which server is the above key registered for? Anonymized means that all data submitted to the services is stripped of the usernames and mail addresses. This also reduces spam detection rates, though.'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS', 'TypePad Antispam'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET', 'Original Akismet'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS_ANON', 'TypePad Antispam (anonymized)'); +@define('PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET_ANON', 'Original Akismet (anonymized)'); diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index 833b1d19..ead088d0 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -39,7 +39,7 @@ var $filter_defaults; 'smarty' => '2.6.7', 'php' => '4.1.0' )); - $propbag->add('version', '1.71'); + $propbag->add('version', '1.72'); $propbag->add('event_hooks', array( 'frontend_saveComment' => true, 'external_plugin' => true, @@ -263,10 +263,12 @@ var $filter_defaults; // to akismet. Otherwise, encourage adoption of the Open // Source alternative, TypePad Antispam. $curr_key = $this->get_config('akismet', false); - $propbag->add('default', (empty($curr_key)?'akismet':'tpas')); + $propbag->add('default', (empty($curr_key) ? 'akismet' : 'tpas')); $propbag->add('radio', array( - 'value' => array('tpas', 'akismet'), - 'desc' => array(PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS, PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET) + 'value' => array('tpas', 'akismet', 'anon-tpas', 'anon-akismet'), + 'desc' => array(PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS, PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET, + PLUGIN_EVENT_SPAMBLOCK_SERVER_TPAS_ANON, PLUGIN_EVENT_SPAMBLOCK_SERVER_AKISMET_ANON + ) )); $propbag->add('radio_per_row', '1'); @@ -484,14 +486,28 @@ var $filter_defaults; // where no server was set $server_type = $this->get_config('akismet_server', 'akismet'); $server = ''; + $anon = false; + switch ($server_type) { - case 'tpas': - $server = 'api.antispam.typepad.com'; - break; - case 'akismet': - $server = 'rest.akismet.com'; - break; + case 'anon-tpas': + $anon = true; + case 'tpas': + $server = 'api.antispam.typepad.com'; + break; + + case 'anon-akismet': + $anon = true; + case 'akismet': + $server = 'rest.akismet.com'; + break; } + + if ($anon) { + $data['comment_author'] = 'John Doe'; + $data['comment_author_email'] = ''; + $data['comment_author_url'] = ''; + } + if (empty($server)) { $this->log($this->logfile, $eventData['id'], 'AKISMET_SERVER', 'No Akismet server found', $addData); $ret['is_spam'] = false;