[pLog-svn] r6149 - in plugins/branches/lifetype-1.2/recaptcha: . class/action class/security class/view locale templates

reto at devel.lifetype.net reto at devel.lifetype.net
Mon Jan 7 17:53:54 EST 2008


Author: reto
Date: 2008-01-07 17:53:54 -0500 (Mon, 07 Jan 2008)
New Revision: 6149

Modified:
   plugins/branches/lifetype-1.2/recaptcha/TODO
   plugins/branches/lifetype-1.2/recaptcha/changelog
   plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php
   plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php
   plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php
   plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php
   plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php
   plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php
   plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php
   plugins/branches/lifetype-1.2/recaptcha/readme.txt
   plugins/branches/lifetype-1.2/recaptcha/templates/recaptcha.template
Log:
updating the recaptcha plugin as of ticket 1439 - tnx tobi.



Modified: plugins/branches/lifetype-1.2/recaptcha/TODO
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/TODO	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/TODO	2008-01-07 22:53:54 UTC (rev 6149)
@@ -2,3 +2,6 @@
 user-config-section.
  
 * Let the user decide about which style of the recaptcha-let to use.
+* Modify the template that way, that the administration form has context help
+
+

Modified: plugins/branches/lifetype-1.2/recaptcha/changelog
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/changelog	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/changelog	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,13 +1,36 @@
-recaptcha_plugin (20071102) 
+recaptcha_plugin (20080104) 
 
+  * the private key will be now hidden in the settings. (if you don't want this
+    edit the locales/<your-language>.php as descibed there)
+  * the validator accepted empty keys, even if it should not. 
+  * typo in template, so that the locale entry for the priv key help has not 
+    been used.
+ 
+ -- Tobias Frost <tobi at coldtobi.de>  Fri Jan  4 21:56:20 CET 2008
+
+
+recaptcha_plugin (20071120) 
+
+  * Fixed some typos, for example in the readme... (I wonder which in condition I was
+    when I typed this...)
+  * Synced the changes made by the lifetype developers when releasing to
+    sourceforge. (Left in some debug code, missed to rename a class. Thnx
+    for the reviewing!)
+  * Added a link to a plugin-dedicated article to the readme.
+  * Fixed a left-over in the template.
+
+ -- Tobias Frost <tobi at coldtobi.de>  Tue Nov 20 13:53:48 CET 2007
+
+recaptcha_plugin (20071102)
+
   * Added German locale
   * Fixed some file-headers, which were forgotten.
   * Changed version number to more common scheme (yyyymmdd)
 
- -- Tobiasa Frost <tobi at coldtobi.de>  Fri Nov  2 11:10:34 CET 2007
+ -- Tobias Frost <tobi at coldtobi.de>  Fri Nov  2 11:10:34 CET 2007
 
-recaptcha_plugin (1.00) 
+recaptcha_plugin (1.00)
 
   * First Version
 
- -- Tobiasa Frost <tobi at coldtobi.de>  Thu Nov  1 13:03:36 CET 2007
+ -- Tobias Frost <tobi at coldtobi.de>  Thu Nov  1 13:03:36 CET 2007 
\ No newline at end of file

Modified: plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -20,7 +20,7 @@
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
 	lt_include( PLOG_CLASS_PATH."plugins/recaptcha/class/view/pluginrecaptchaconfigview.class.php" );  
 
-    	class PluginRecaptchaConfigAction extends AdminAction 
+    	class PluginRecaptchaConfigAction extends AdminAction
 	{
 
     	/**
@@ -37,12 +37,10 @@
          */
         function perform()
         {
-			$this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
-
-            $this->setCommonData();
-
-            // better to return true if everything fine
-            return true;
+		$this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
+		$this->setCommonData();
+		// better to return true if everything fine
+		return true;
         }
     }
 ?>

Modified: plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,98 +1,104 @@
 <?php
 
-    /*  Copyright 2007 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
+/*  Copyright 2007, 2008 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-    
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-    */
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-    lt_include( PLOG_CLASS_PATH."plugins/recaptcha/class/view/pluginrecaptchaconfigview.class.php" ); 
-    
-    class PluginRecaptchaUpdateConfigAction extends AdminAction 
-	{
-	
-		var $_pluginEnabled;
-		var $_pubkey;
-		var $_privkey;
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
 
-    	/**
-         * Constructor. If nothing else, it also has to call the constructor of the parent
-         * class, BlogAction with the same parameters
-         */
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+lt_include( PLOG_CLASS_PATH."plugins/recaptcha/class/view/pluginrecaptchaconfigview.class.php" ); 
+
+class PluginRecaptchaUpdateConfigAction extends AdminAction 
+{
+
+	var $_pluginEnabled;
+	var $_pubkey;
+	var $_privkey;
+
+	/**
+	 * Constructor. If nothing else, it also has to call the constructor of the parent
+	 * class, BlogAction with the same parameters
+	*/
         function PluginRecaptchaUpdateConfigAction( $actionInfo, $request )
         {
         	$this->AdminAction( $actionInfo, $request );
         }
 		
-		function validate()
+	function validate()
+	{
+		$this->_pluginEnabled = (0 != ($this->_request->getValue( "pluginEnabled" )));
+			
+		$this->_pubkey  = trim($this->_request->GetValue( "PubKey"));
+		$this->_privkey = trim($this->_request->GetValue( "PrivKey"));
+		
+		if ( $this-> _pluginEnabled )
 		{
-	        $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
-            $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
-            
-            $this->_pubkey  = $this->_request->GetValue( "PubKey");
-            $this->_privkey = $this->_request->GetValue( "PrivKey");
-            
-            if ( $_pluginEnabled)
-            {
-                if ( trim($_pubkey) == "" || trim($_privkey) == "" )    
-                {
-                    $this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
-                    $this->_view->setErrorMessage($this->_locale->tr("recaptcha_error_key"));
-                    $this->setCommonData();
-                    return false;                
-                }    
-            }
-			return true;
+			if ( $this->_pubkey == "" || $this->_privkey == "" )
+			{
+				$this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
+				$this->_view->setErrorMessage($this->_locale->tr("recaptcha_error_key"));
+				$this->setCommonData();
+				return false;
+			}
+		}	
+		return true;
+	}
+
+	/**
+	* Carries out the specified action
+	*/
+	function perform()
+	{
+		// update the plugin configurations to blog setting
+		$blogSettings = $this->_blogInfo->getSettings();
+		$blogSettings->setValue( "plugin_recaptcha_enabled", $this->_pluginEnabled );
+		$blogSettings->setValue( "plugin_recaptcha_pubkey", $this-> _pubkey);
+		
+		$locale = Locales::getLocale( $blogSettings->getValue( "locale" ) );
+		$tmp =  trim($this->_locale->tr("recaptcha_mangled_key"));
+		if ( $tmp != $this->_privkey )
+		{
+		  $blogSettings->setValue( "plugin_recaptcha_privkey", $this-> _privkey);
 		}
 		
-        /**
-         * Carries out the specified action
-         */
-        function perform()
-        {
-            // update the plugin configurations to blog setting
-	    $blogSettings = $this->_blogInfo->getSettings();
-            $blogSettings->setValue( "plugin_recaptcha_enabled", $this->_pluginEnabled );
-            $blogSettings->setValue( "plugin_recaptcha_pubkey", $this-> _pubkey);
-            $blogSettings->setValue( "plugin_recaptcha_privkey", $this-> _privkey);
-
-            $this->_blogInfo->setSettings( $blogSettings ); 
-
- 	// save the blogs settings
-	    $blogs = new Blogs();
-            if( !$blogs->updateBlog( $this->_blogInfo )) {
-                $this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
-                $this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
-                $this->setCommonData();
-                return false;
-            }
-
-			// if everything went ok...
-            $this->_blogInfo->setSettings( $blogSettings );
-            $this->_session->setValue( "blogInfo", $this->_blogInfo );
-            $this->saveSession();
-			
+		$this->_blogInfo->setSettings( $blogSettings ); 
+	
+		// save the blogs settings
+		$blogs = new Blogs();
+		if( !$blogs->updateBlog( $this->_blogInfo )) {
 			$this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
-			$this->_view->setSuccessMessage( $this->_locale->tr("recaptcha_settings_saved_ok"));
+			$this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
 			$this->setCommonData();
-			
-			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());	
+			return false;
+		}
+	
+		// if everything went ok...
+		$this->_blogInfo->setSettings( $blogSettings );
+		$this->_session->setValue( "blogInfo", $this->_blogInfo );
+		$this->saveSession();
+		
+		$this->_view = new PluginRecaptchaConfigView( $this->_blogInfo );
+		$this->_view->setSuccessMessage( $this->_locale->tr("recaptcha_settings_saved_ok"));
+		$this->setCommonData();
+		
+		// clear the cache
+		CacheControl::resetBlogCache( $this->_blogInfo->getId());
+		
+		return true;
+	}
 
-            return true;		
-        }
-    }
- 
+}
+
 ?>

Modified: plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,37 +1,35 @@
 <?php
 
-    /* Copyright 2007 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
+/* Copyright 2007 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-    
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-    */
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 lt_include( PLOG_CLASS_PATH."class/security/pipelinefilter.class.php" );
 
 require_once(PLOG_CLASS_PATH."plugins/recaptcha/library/recaptchalib.php");
 
-    
 // custom error code that will be returned to the pipeline whenever an
 // error is found... Be careful so as to not to have two different modules
 // use the same code!!
 define( "RECAPTCHA_SPAM", 43534 );
 
-
 class ReCaptchaFilter extends PipelineFilter 
 {
 
-    function ReCaptchaFilter( $pipelineRequest )
+	function ReCaptchaFilter( $pipelineRequest )
 	{
 		$this->PipelineFilter( $pipelineRequest );
 	}
@@ -46,10 +44,9 @@
 		if( !$pluginEnabled) {
 			return new PipelineResult();
 		}
-	
-	
+
 		// 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		
+		// so there's no point in doing anything else if that's not the case
 		$request  = $this->_pipelineRequest->getHttpRequest();
 		if( $request->getValue( "op" ) != "AddComment" ) {
 			return new PipelineResult();
@@ -75,10 +72,10 @@
 			return new PipelineResult( false, RECAPTCHA_SPAM, $locale->tr("recaptcha_captcha_wrong"));
 		}
 		
-		// truing test passed ! 
+		// human after all !?
 		return new PipelineResult();	
 	}
 
-}  
+}
 
 ?>

Modified: plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,50 +1,59 @@
 <?php
 	
-    /* Copyright 2007 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
+/* Copyright 2007, 2008 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-    
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-    */
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-	lt_include( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
 
-	/**
-	 * implements the main view of the validate trackback plugin
-	 */
-	class PluginRecaptchaConfigView extends AdminPluginTemplatedView
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+lt_include( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+/**
+ * implements the main view of the ReCaptcha Plugin
+*/
+class PluginRecaptchaConfigView extends AdminPluginTemplatedView
+{
+
+	function PluginRecaptchaConfigView( $blogInfo )
 	{
-
-		function PluginRecaptchaConfigView( $blogInfo )
+		$this->AdminPluginTemplatedView( $blogInfo, "recaptcha", "recaptcha" );
+	}
+	
+	function render()
+	{
+		// load some configuration settings
+		$blogSettings 	= $this->_blogInfo->getSettings();
+		
+		$pluginEnabled 	= $blogSettings->getValue( "plugin_recaptcha_enabled"  );
+		$PubKey	   	= $blogSettings->getValue( "plugin_recaptcha_pubkey"   );
+		$PrivKey	= $blogSettings->getValue( "plugin_recaptcha_privkey"  );
+		
+		// mangle the keys so that they are not exposed.
+		// But only, if it was set previously.
+		if ( $PrivKey != "" )
 		{
-			$this->AdminPluginTemplatedView( $blogInfo, "recaptcha", "recaptcha" );
+		  $locale = Locales::getLocale( $blogSettings->getValue( "locale" ) );
+		  $tmp =  trim($locale->tr("recaptcha_mangled_key"));
+		  if ( $tmp != "" && $tmp != "recaptcha_mangled_key" )  $PrivKey = $tmp;
 		}
 		
-		function render()
-		{
-			// load some configuration settings
-			$blogSettings 	= $this->_blogInfo->getSettings();
-			
-			$pluginEnabled 	= $blogSettings->getValue( "plugin_recaptcha_enabled"  );
-			$PubKey 	   	= $blogSettings->getValue( "plugin_recaptcha_pubkey"   );
-			$PrivKey 		= $blogSettings->getValue( "plugin_recaptcha_privkey"  );
-			
-			// create a view and export the settings to the template
-			$this->setValue( "pluginEnabled", $pluginEnabled );
-			$this->setValue( "PubKey"		, $PubKey );
-			$this->setValue( "PrivKey"		, $PrivKey );
-			
-			parent::render();
-		}
+		// create a view and export the settings to the template
+		$this->setValue( "pluginEnabled", $pluginEnabled );
+		$this->setValue( "PubKey"		, $PubKey );
+		$this->setValue( "PrivKey"		, $PrivKey );
+		
+		parent::render();
 	}
+}
 ?>

Modified: plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,21 +1,42 @@
 <?php
+/*   Copyright 2007, 2008 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 $messages["plugin_recaptcha"] = "reCAPTCHA";
 $messages["recaptcha_captcha_wrong"] = "Das Captcha war falsch."; 
 $messages["recaptcha_plugin_enabled"] = "Dieses Plugin aktivieren";
-$messages["recaptcha_privatekey"] 	= "Privater ReCaptcha-Schlüssel (private key)";
+$messages["recaptcha_privatekey"] 	= "Privater ReCaptcha-Schl&uuml;ssel (private key). Der gespeicherte Schl&uuml;ssel wird zur Sicherheit nicht im Klartext angezeigt.";
 $messages["recaptcha_pubkey"] 	 	= "&Ouml;ffentlicher ReCaptcha-Schl&uuml;ssel (public key)";
 $messages["recaptcha_type_code"] = "Bitte Captcha l&ouml;sen (erforderlich)";
 
 $messages["label_configuration"] = "Konfiguration";
 $messages["label_enable"]  = "Aktivieren";
-$messages["label_pubkey"]  = "Privater ReCaptcha-Schl&uuml;ssel";
-$messages["label_privkey"] = "&Ouml;ffentlicher ReCaptcha-Schl&uuml;ssel";
+$messages["label_pubkey"]  = "&Ouml;ffentlicher ReCaptcha-Schl&uuml;ssel";
+$messages["label_privkey"] = "Privater ReCaptcha-Schl&uuml;ssel";
 
 $messages["recaptcha_error_key"] = "Fehler: &Ouml;ffentlicher oder Privater Schl&uuml;ssel nicht konfiguriert.";
 
+/* this string is displayed as a replacement for the secret key in the configuration dialog. 
+if set empty, the will not be hidden and will be exposed to any user which is able to change the recaptcha
+configuration.*/
+$messages["recaptcha_mangled_key"] ="***";
+
 $messages["recaptcha_settings_saved_ok"] = "ReCaptcha Einstellungen erfolgreich gespeichert.";
 
-
+/* general strings. */
 $messages["manageAntiSpamPlugins"] = "Anti Spam Management";
 
 ?>

Modified: plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,8 +1,24 @@
 <?php
+/*   Copyright 2007, 2008 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 $messages["plugin_recaptcha"] = "reCAPTCHA";
 $messages["recaptcha_captcha_wrong"] = "The captcha you have entered is wrong."; 
 $messages["recaptcha_plugin_enabled"] = "Enable this plugin";
-$messages["recaptcha_privatekey"] 	= "Your ReCaptcha private key.";
+$messages["recaptcha_privatekey"] 	= "Your ReCaptcha private key. (The saved key is not shown to keep it secret.)";
 $messages["recaptcha_pubkey"] 	 	= "Your ReCaptcha public key";
 $messages["recaptcha_type_code"] = "Please solve the puzzle (required)";
 
@@ -11,11 +27,16 @@
 $messages["label_pubkey"]  = "ReCaptcha Public Key";
 $messages["label_privkey"] = "ReCaptcha Private Key";
 
-$messages["recaptcha_error_key"] = "Error: Public and Private Key must be set.";
+$messages["recaptcha_error_key"] = "Error: public or private key empty.";
 
+/* this string is displayed as a replacement for the secret key in the configuration dialog. 
+if set "empty", the will not be hidden and will be exposed to any user which is able to change the recaptcha
+configuration.*/
+$messages["recaptcha_mangled_key"] ="***";
+
 $messages["recaptcha_settings_saved_ok"] = "ReCaptcha Settings saved successfully.";
 
-/* alt starts here: */
+/* general strings. */
 $messages["manageAntiSpamPlugins"] = "Anti Spam Management";
 
 ?>

Modified: plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,97 +1,96 @@
-<?php
-
-    /*   Copyright 2007 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-    */
-
-	lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-
-	require_once(PLOG_CLASS_PATH."plugins/recaptcha/library/recaptchalib.php");
-
-	class PluginRecaptcha extends PluginBase
-	{
-		var $pluginEnabled;
-		var $PubKey;
-		var $PrivKey; 
- 	
-		function PluginReCaptcha( $source = "" )
-		{
-			$this->PluginBase($source);
-
-			$this->id      = "recaptcha";
-			$this->desc    = "This plugin implements the recaptcha captcha generation. See http://recaptcha.net/ for details and how to obtain the API Key.";
-			$this->author  = "Tobias Frost";
-			$this->locales = Array( "en_UK","de" );
-            		$this->version = "20071102";
-
-
-			if( $source == "admin" )
-				$this->initAdmin();
-			else
-				$this->init();
-		}
-
-		function init()
-		{
-			lt_include(PLOG_CLASS_PATH."plugins/recaptcha/class/security/recaptchafilter.class.php"); 
-			$this->registerFilter( "ReCaptchaFilter" ); 
-		}
-
-		function initAdmin()
-		{
-			$this->init();
-			
-			$this->registerAdminAction( "recaptcha", "PluginRecaptchaConfigAction" ); // TODO ACTION
-			$this->registerAdminAction( "updateRecaptchaConfig", "PluginRecaptchaUpdateConfigAction" ); // TODO CONFIG
-			
-			$menu =& Menu::getMenu();
-			if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))
-				$this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "", true, false );
-				$this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "plugin_recaptcha", "?op=recaptcha", "" ); 
-		}
-	
-		function register()
-		{
-			$blogSettings 		= $this->blogInfo->getSettings();
-			$this->pluginEnabled 	= $blogSettings->getValue( "plugin_recaptcha_enabled" );
-			$this->PubKey 	     	= $blogSettings->getValue( "plugin_recaptcha_pubkey" );
-			$this->PrivKey 		= $blogSettings->getValue( "plugin_recaptcha_privkey" );
-		}
-			
-		function show() {
-	                $result = recaptcha_get_html ($this->PubKey) . "<p style=\"font-size:6pt;padding-left:2em;width:500px;\">&nbsp;<a href=\"http://blog.coldtobi.de\">This is the ReCaptcha Plugin for Lifetype </a></p>";
-			return $result;
-		}
-
-		function isEnabled()
-		{
-			return $this->pluginEnabled;
-		}
-	
-		function getPluginConfigurationKeys()
-		{
-			lt_include(PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php");
-			lt_include(PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
-
-			return( Array(
-				Array( "name" => "plugin_recaptcha_enabled", "type" => "boolean" ),
-				Array( "name" => "plugin_recaptcha_privkey", "validator" => new
-StringValidator(),  "type" => "string", "allowEmpty" => true ),
-				Array( "name" => "plugin_recaptcha_pubkey", "validator" => new StringValidator(), "type" => 	"string", "allowEmpty" => true )));
-		}
-
-}
-?>
+<?php
+
+    /*   Copyright 2007, 2008 Tobias Frost <tobi at coldtobi.de> http://blog.coldtobi.de
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    */
+
+	lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+	lt_include( PLOG_CLASS_PATH."plugins/recaptcha/library/recaptchalib.php");
+
+	class PluginRecaptcha extends PluginBase
+	{
+		var $pluginEnabled;
+		var $PubKey;
+		var $PrivKey; 
+ 	
+		function PluginReCaptcha( $source = "" )
+		{
+			$this->PluginBase($source);
+
+			$this->id      = "recaptcha";
+			$this->desc    = "This plugin implements the recaptcha captcha generation. <br/>See <a href=\"http://recaptcha.net/\">http://recaptcha.net/</a> for details. To obtain a API Key, click <a href=http://recaptcha.net/api/getkey?app=lifetype>here</a>. <br>For updates or beta versions of this plugin, check out <a href=\"http://blog.coldtobi.de/blog-website/2007/11/20/recaptcha_plugin\"> http://blog.coldtobi.de/blog-website/2007/11/20/recaptcha_plugin </a>";
+			$this->author  = "Tobias Frost";
+			$this->locales = Array( "en_UK","de_DE" );
+            $this->version = "20080104";
+
+
+			if( $source == "admin" )
+				$this->initAdmin();
+			else
+				$this->init();
+		}
+
+		function init()
+		{
+			lt_include(PLOG_CLASS_PATH."plugins/recaptcha/class/security/recaptchafilter.class.php"); 
+			$this->registerFilter( "ReCaptchaFilter" ); 
+		}
+
+		function initAdmin()
+		{
+			$this->init();
+			
+			$this->registerAdminAction( "recaptcha", "PluginRecaptchaConfigAction" ); 
+			$this->registerAdminAction( "updateRecaptchaConfig", "PluginRecaptchaUpdateConfigAction" ); 
+			
+			$menu =& Menu::getMenu();
+			if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))
+				$this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "", true, false );
+				$this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "plugin_recaptcha", "?op=recaptcha", "" ); 
+		}
+	
+		function register()
+		{
+			$blogSettings 		= $this->blogInfo->getSettings();
+			$this->pluginEnabled 	= $blogSettings->getValue( "plugin_recaptcha_enabled" );
+			$this->PubKey 	     	= $blogSettings->getValue( "plugin_recaptcha_pubkey" );
+			$this->PrivKey 		= $blogSettings->getValue( "plugin_recaptcha_privkey" );
+		}
+			
+		function show() {
+	                $result = recaptcha_get_html ($this->PubKey) . "<p style=\"font-size:6pt;padding-left:2em;width:500px;\">&nbsp;<a href=\"http://blog.coldtobi.de\">This is the ReCaptcha Plugin for Lifetype </a></p>";
+			return $result;
+		}
+
+		function isEnabled()
+		{
+			return $this->pluginEnabled;
+		}
+	
+		function getPluginConfigurationKeys()
+		{
+			lt_include(PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php");
+			lt_include(PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
+
+			return( Array(
+				Array( "name" => "plugin_recaptcha_enabled", "type" => "boolean" ),
+				Array( "name" => "plugin_recaptcha_privkey", "validator" => new
+StringValidator(),  "type" => "string", "allowEmpty" => true ),
+				Array( "name" => "plugin_recaptcha_pubkey", "validator" => new StringValidator(), "type" => 	"string", "allowEmpty" => true )));
+		}
+
+}
+?>

Modified: plugins/branches/lifetype-1.2/recaptcha/readme.txt
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/readme.txt	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/readme.txt	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,93 +1,78 @@
-Plugin: ReCaptcha
-Author: Tobias Frost (blog.coldtobi.de)
-Release Date: 2007/11/02
-Version: 20071102
-
-
-
-LICENSE
-========
-
-Recaptcha Library (folder recaptcha/library)
-
-The recaptcha library redistributed in this packages is not by me, and has its 
-own LICENSE file. Please read it carefully. The library also be downloaded at
-http://recaptcha.net/plugins/php/
-
-ReCaptcha Plugin
-The plugin is licensed under the GPL v2. See the file copyright for details.
-
-ABSTRACT
-=========
-
-This plugin implements the ReCaptcha Captcha authentification. 
-
-Recaptcha is like regular captchas, but in contrast to regular captchas
-these are from scanned books and they already failed being recognized by 
-a OCR, so according to the authors of recaptcha this method is far more
-effecive than "regular" captcha.
-For details on  ReCaptcha, please visit http://recaptcha.net.
-
-
-WARNING
-=======
-
-I am not a php programmer. I have strong programming knowledge, but I do not
-really know php. There could be security issues in the code, so please make
-sure to check the code for safety and give me feedback on any findings.
-
-RECAPTCHA API KEY
-=================
-
-You can obtain your recaptcha API Keys from recaptcha.org. Please note that it is only
-good for one domain including all subdomains.
-
-If you host serveral blogs on different domains, you might want to let the blog owners 
-enter their codes individually, and do not enter anything in the Administration Settings.
-
-WARNING: If the code is entered in the Admin section, all blog users can see it! I still have to
-figure out how to avoid it. Please mail me hints/patches.
-
-
-MOTIVIATION, FEEDBACK
-=====================
-Some time ago, I stumbled upon recaptcha. 
-(Story http://blog.coldtobi.de/1_coldtobis_blog/archive/89_recaptcha_--_stop_spam_read_books.html)
-However, as lifetype currently does not have a well performing captcha plugin,
-leading to a lots of automated spam, I decided to implement this. 
-
-Please send me your feedback using my blog or mail me at tobi at coldtobi.de.
-
-You will probably notice, that I placed a link to my blog at the bottom of the 
-captcha. If you like the plugin, I ask you let it intact.
-
-
-SETUP & CONFIGURATION
-=====================
-
-In order to employ the plugin, do the following
-1. Obtain your API Key at recaptcha.net
-2. Unzip the zip-file 
-3. Configure the plugin with the keys. (See section "Rechapta API Key" for details")
-4. Add the code to the commentform.template:
-
-    { ** Plugin_Recaptcha Code start. ** }
-    { ** VERSION plugin_recaptcha 1.00 ** }
-    {if $recaptcha && $recaptcha->isEnabled()}
-        <div>
-            <label for="recaptcha">{$locale->tr("recaptcha_type_code")}</label>
-            <div style="float:left" id=recaptcha>
-                {$recaptcha->show()}
-            </div>
-            <div style="clear:left"></div>
-        </div>
-    {/if}
-    { ** Plugin_Recaptcha Code end  ** }
-
-
-
-
-
-
-
-
+Plugin: ReCaptcha
+Author: Tobias Frost (blog.coldtobi.de)
+Release Date: 2007/11/20
+
+For Development-Versions, Bug-Reports etc please visit this dedicated
+article on my blog:
+http://blog.coldtobi.de/blog-website/2007/11/20/recaptcha_plugin
+
+LICENSE
+========
+
+ReCaptcha Library (folder recaptcha/library)
+
+The ReCaptcha library redistributed in this packages is not written by  me, 
+and has its own LICENSE file. Please read it carefully. The library also 
+be downloaded at http://recaptcha.net/plugins/php/
+
+ReCaptcha Plugin
+The plugin is licensed under the GPL v2. See the file copyright for details.
+
+ABSTRACT
+=========
+
+This plugin implements the ReCaptcha captcha authentications. 
+
+ReCaptcha is like regular captchas, but in contrast to "regular" ones
+these are from scanned books and they already failed being recognized by 
+a OCR. So according to the authors of reCaptcha this method is far more
+effective. 
+For details on  ReCaptcha, please visit http://recaptcha.net.
+
+
+RECAPTCHA API KEY
+=================
+
+You can obtain your ReCaptcha API Key from recaptcha.org. Please note, that it is only
+good for one domain (including all sub-domains).
+
+If you host several blogs on different domains, you might want to let the blog owners 
+enter their codes individually, and not enter anything in the Administration Settings.
+
+
+MOTIVATION, FEEDBACK
+=====================
+Some time ago, I stumbled upon ReCaptcha. 
+(Story http://blog.coldtobi.de/blog-website/2007/07/05/recaptcha-stop-spam-read-books)
+However, as life type currently does not have a well performing captcha plugin,
+leading to a lots of automated spam, I decided to implement this. 
+
+Please send me your feedback using my blog or mail me at tobi at coldtobi.de.
+
+You'll probably notice, that I placed a link to my blog at the bottom of the 
+captcha. If you like the plugin, I ask you let it intact. 
+
+
+SETUP & CONFIGURATION
+=====================
+
+In order to employ the plugin, do the following
+1. Obtain your API Key at recaptcha.net
+2. Unzip the zip-file 
+3. Configure the plugin with the keys. (See section "ReCaptcha API Key" for details")
+4. Add the code to the commentform.template:
+(For best results, check it after instalation: Maybe you have to modify some spacing, or the clearer div)
+
+    { ** Plugin_Recaptcha Code start. ** }
+    { ** VERSION plugin_recaptcha 1.00 ** }
+    {if $recaptcha && $recaptcha->isEnabled()}
+        <div>
+            <label for="recaptcha">{$locale->tr("recaptcha_type_code")}</label>
+            <div style="float:left" id=recaptcha>
+                {$recaptcha->show()}
+            </div>
+            <div style="clear:left"></div>
+        </div>
+    {/if}
+    { ** Plugin_Recaptcha Code end  ** }
+

Modified: plugins/branches/lifetype-1.2/recaptcha/templates/recaptcha.template
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/templates/recaptcha.template	2008-01-07 11:48:44 UTC (rev 6148)
+++ plugins/branches/lifetype-1.2/recaptcha/templates/recaptcha.template	2008-01-07 22:53:54 UTC (rev 6149)
@@ -1,5 +1,5 @@
 {include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=plugin_recaptcha title=$locale->tr("plugin_recaptcha")}
+{include file="$admintemplatepath/navigation.template" showOpt=ReCaptcha title=$locale->tr("recaptcha_plugin")}
 
 <form name="recaptchapluginConfig" action="admin.php" method="post">
  <fieldset class="inputField">



More information about the pLog-svn mailing list