[pLog-svn] r5931 - in plugins/branches/lifetype-1.2/akismet: . class/action class/security class/view locale templates
pwestbro at devel.lifetype.net
pwestbro at devel.lifetype.net
Fri Sep 14 18:27:10 EDT 2007
Author: pwestbro
Date: 2007-09-14 18:27:10 -0400 (Fri, 14 Sep 2007)
New Revision: 5931
Modified:
plugins/branches/lifetype-1.2/akismet/class/action/pluginakismetupdateconfigaction.class.php
plugins/branches/lifetype-1.2/akismet/class/security/akismetfilter.class.php
plugins/branches/lifetype-1.2/akismet/class/view/pluginakismetconfigview.class.php
plugins/branches/lifetype-1.2/akismet/locale/locale_en_UK.php
plugins/branches/lifetype-1.2/akismet/pluginakismet.class.php
plugins/branches/lifetype-1.2/akismet/templates/akismet.template
Log:
Akismet can be very agressive on blocking trackbacks. Allow the user to
control if akismet should be used on trackbacks
Modified: plugins/branches/lifetype-1.2/akismet/class/action/pluginakismetupdateconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/akismet/class/action/pluginakismetupdateconfigaction.class.php 2007-09-14 19:55:40 UTC (rev 5930)
+++ plugins/branches/lifetype-1.2/akismet/class/action/pluginakismetupdateconfigaction.class.php 2007-09-14 22:27:10 UTC (rev 5931)
@@ -25,6 +25,7 @@
{
var $_pluginEnabled;
+ var $_trackbackCheckingEnabled;
var $_apiKey;
@@ -45,6 +46,9 @@
$this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
$this->_pluginEnabled = ($this->_pluginEnabled != "" );
+
+ $this->_trackbackCheckingEnabled = $this->_request->getValue( "trackbackEnabled" );
+ $this->_trackbackCheckingEnabled = ($this->_trackbackCheckingEnabled != "" );
$this->_apiKey = $this->_request->getValue( "apiKey" );
@@ -87,6 +91,7 @@
// update the plugin configurations to blog setting
$blogSettings = $this->_blogInfo->getSettings();
$blogSettings->setValue( "plugin_akismet_enabled", $this->_pluginEnabled );
+ $blogSettings->setValue( "plugin_akismet_trackback_checking_enabled", $this->_trackbackCheckingEnabled );
$blogSettings->setValue( "plugin_akismet_api_key", $this->_apiKey );
Modified: plugins/branches/lifetype-1.2/akismet/class/security/akismetfilter.class.php
===================================================================
--- plugins/branches/lifetype-1.2/akismet/class/security/akismetfilter.class.php 2007-09-14 19:55:40 UTC (rev 5930)
+++ plugins/branches/lifetype-1.2/akismet/class/security/akismetfilter.class.php 2007-09-14 22:27:10 UTC (rev 5931)
@@ -48,6 +48,7 @@
//_debug("ip address filter not enabled! quitting...<br/>");
return new PipelineResult();
}
+ $trackbackCheckingEnabled = $blogSettings->getValue( "plugin_akismet_trackback_checking_enabled" );
// we only have to filter the contents if the user is posting a comment
// so there's no point in doing anything else if that's not the case
@@ -55,6 +56,14 @@
$result = new PipelineResult();
return $result;
}
+
+ // This could be combined with the above condition, but leaving it seperate
+ // makes it clearer.
+ if ( $request->getValue( "op" ) == "AddTrackback" && $trackbackCheckingEnabled == false )
+ {
+ $result = new PipelineResult();
+ return $result;
+ }
// if this is already rejected, there is no reason to do anything here
if ( $this->_pipelineRequest->getRejectedState() )
Modified: plugins/branches/lifetype-1.2/akismet/class/view/pluginakismetconfigview.class.php
===================================================================
--- plugins/branches/lifetype-1.2/akismet/class/view/pluginakismetconfigview.class.php 2007-09-14 19:55:40 UTC (rev 5930)
+++ plugins/branches/lifetype-1.2/akismet/class/view/pluginakismetconfigview.class.php 2007-09-14 22:27:10 UTC (rev 5931)
@@ -36,12 +36,14 @@
// load some configuration settings
$blogSettings = $this->_blogInfo->getSettings();
$pluginEnabled = $blogSettings->getValue( "plugin_akismet_enabled" );
+ $trackbackChecking = $blogSettings->getValue( "plugin_akismet_trackback_checking_enabled" );
$apiKey = $blogSettings->getValue( "plugin_akismet_api_key" );
// create a view and export the settings to the template
$this->setValue( "pluginEnabled", $pluginEnabled );
+ $this->setValue( "trackbackEnabled", $trackbackChecking );
$this->setValue( "apiKey", $apiKey );
parent::render();
Modified: plugins/branches/lifetype-1.2/akismet/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.2/akismet/locale/locale_en_UK.php 2007-09-14 19:55:40 UTC (rev 5930)
+++ plugins/branches/lifetype-1.2/akismet/locale/locale_en_UK.php 2007-09-14 22:27:10 UTC (rev 5931)
@@ -6,6 +6,7 @@
$messages["akismet_plugin_enabled"] = "Enable this plugin";
$messages["akismet_api_key"] = "Akismet API key to be used for spam checking. To obtain key go to <a href='http://wordpress.com/api-keys/'>http://wordpress.com/api-keys/</a>";
$messages["akismet_plugin"] = "Akismet Plugin";
+$messages["akismet_trackback_checking"] = "Enable trackback ckecking";
$messages["akismet_settings_saved_ok"] = "Akismet settings saved successfully!";
$messages["akismet_missing_api_key"] = "Akismet API key needs to be specified!";
@@ -17,4 +18,6 @@
$messages["label_configuration"] = "Configuration";
$messages["label_enable"] = "Enable";
$messages["label_akismet_api_key"] = "Akismet API key";
+$messages["label_akismet_trackback_checking"] = "Enable trackback checking";
+
?>
\ No newline at end of file
Modified: plugins/branches/lifetype-1.2/akismet/pluginakismet.class.php
===================================================================
--- plugins/branches/lifetype-1.2/akismet/pluginakismet.class.php 2007-09-14 19:55:40 UTC (rev 5930)
+++ plugins/branches/lifetype-1.2/akismet/pluginakismet.class.php 2007-09-14 22:27:10 UTC (rev 5931)
@@ -32,7 +32,7 @@
$this->desc = "Akismet checks your comments against the Akismet web serivce to see if they look like spam or not.";
$this->author = "Paul Westbrook (Akismet php library provided by <a href=\"http://miphp.net/blog/view/php4_akismet_class\">Bret Kuhns</a>)";
$this->locales = Array( "en_UK" );
- $this->version = "20070805";
+ $this->version = "20070914";
if( $source == "admin" )
$this->initAdmin();
@@ -127,6 +127,7 @@
return( Array(
Array( "name" => "plugin_akismet_enabled", "type" => "boolean" ),
+ Array( "name" => "plugin_akismet_trackback_checking_enabled", "type" => "boolean" ),
Array( "name" => "plugin_akismet_api_key", "validator" => new StringValidator(), "type" => "string", "allowEmpty" => true ),
));
}
Modified: plugins/branches/lifetype-1.2/akismet/templates/akismet.template
===================================================================
--- plugins/branches/lifetype-1.2/akismet/templates/akismet.template 2007-09-14 19:55:40 UTC (rev 5930)
+++ plugins/branches/lifetype-1.2/akismet/templates/akismet.template 2007-09-14 22:27:10 UTC (rev 5931)
@@ -1,5 +1,5 @@
{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=akismet title=$locale->tr("tagcloud_plugin")}
+{include file="$admintemplatepath/navigation.template" showOpt=akismet title=$locale->tr("akismet_plugin")}
<form name="akismetPluginSettings" method="post">
<fieldset class="inputField">
<legend>{$locale->tr("label_configuration")}</legend>
@@ -13,6 +13,19 @@
</div>
<div class="field">
+ <label for="trackbackEnabled">{$locale->tr("label_akismet_trackback_checking")}</label>
+ <div class="formHelp">
+ <input class="checkbox" type="checkbox" name="trackbackEnabled"
+ id="trackbackEnabled" {if $trackbackEnabled} checked="checked" {/if}
+ {user_cannot_override
+ key=plugin_akismet_trackback_checking_enabled}disabled="disabled"
+ {/user_cannot_override}
+ value="1" />{$locale->tr("akismet_trackback_checking")}
+ </div>
+ </div>
+
+
+ <div class="field">
<label for="apiKey">{$locale->tr("label_akismet_api_key")}</label>
<span class="required">*</span>
<div class="formHelp">{$locale->tr("akismet_api_key")}
More information about the pLog-svn
mailing list