[pLog-svn] r6299 - in plugins/branches/lifetype-1.2/recaptcha: . class/action class/security class/view library locale templates
reto at devel.lifetype.net
reto at devel.lifetype.net
Sun Apr 6 16:11:52 EDT 2008
Author: reto
Date: 2008-04-06 16:11:52 -0400 (Sun, 06 Apr 2008)
New Revision: 6299
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/library/recaptchalib.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 plugin according to the diff in http://bugs.lifetype.net/view.php?id=1480
Modified: plugins/branches/lifetype-1.2/recaptcha/TODO
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/TODO 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/TODO 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,7 +1,2 @@
-* If in the admin-section a private key is entered, do not display it in the
-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
-
-
+* See if we need some other features.
Modified: plugins/branches/lifetype-1.2/recaptcha/changelog
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/changelog 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/changelog 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,3 +1,21 @@
+recaptcha_plugin (20080401)
+
+ * changed the sample template to version 1.1 in the readme to fix some issues:
+ - make sure the widget is placed next to the label. Should look nicer.
+ - if there is too less place for the widget, draw scrollbars.
+ - fix some broken CSS-inheritage of some templates. (Thanks clyde for
+ reporting)
+ * the "hide-the-key-feature" is now a configuration option for the site admin.
+ The hack to configure it using the locales is gone now. Make sure to read
+ the Readme.
+ * updated the recaptcha-php library to version 1.10
+ * Themes can now be configured and used.
+ * the widget is now displayed in the configured blog language. (if this
+ language is supported and is one of these: "en","nl","fr","de","pt","ru",
+ "es","tr")
+
+ -- Tobias Frost <tobi at coldtobi.de> Tue Apr 1 17:57:48 CEST 2008
+
recaptcha_plugin (20080104)
* the private key will be now hidden in the settings. (if you don't want this
@@ -8,10 +26,10 @@
-- 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
+ * 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
Modified: plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaconfigaction.class.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,7 +1,6 @@
<?php
+ /* Copyright 2007, 2008 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
Modified: plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/class/action/pluginrecaptchaupdateconfigaction.class.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,5 +1,4 @@
<?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
@@ -26,6 +25,7 @@
var $_pluginEnabled;
var $_pubkey;
var $_privkey;
+ var $_theme;
/**
* Constructor. If nothing else, it also has to call the constructor of the parent
@@ -39,9 +39,9 @@
function validate()
{
$this->_pluginEnabled = (0 != ($this->_request->getValue( "pluginEnabled" )));
-
$this->_pubkey = trim($this->_request->GetValue( "PubKey"));
$this->_privkey = trim($this->_request->GetValue( "PrivKey"));
+ $this->_theme = trim($this->_request->GetValue( "theme"));
if ( $this-> _pluginEnabled )
{
@@ -65,7 +65,8 @@
$blogSettings = $this->_blogInfo->getSettings();
$blogSettings->setValue( "plugin_recaptcha_enabled", $this->_pluginEnabled );
$blogSettings->setValue( "plugin_recaptcha_pubkey", $this-> _pubkey);
-
+ $blogSettings->setValue( "plugin_recaptcha_theme", $this-> _theme);
+
$locale = Locales::getLocale( $blogSettings->getValue( "locale" ) );
$tmp = trim($this->_locale->tr("recaptcha_mangled_key"));
if ( $tmp != $this->_privkey )
Modified: plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/class/security/recaptchafilter.class.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,6 +1,6 @@
<?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
Modified: plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/class/view/pluginrecaptchaconfigview.class.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -38,21 +38,24 @@
$pluginEnabled = $blogSettings->getValue( "plugin_recaptcha_enabled" );
$PubKey = $blogSettings->getValue( "plugin_recaptcha_pubkey" );
$PrivKey = $blogSettings->getValue( "plugin_recaptcha_privkey" );
-
+ $mangleKey = $blogSettings->getValue( "plugin_recaptcha_manglekey");
+ $theme = $blogSettings->getValue( "plugin_recaptcha_theme");
+
// mangle the keys so that they are not exposed.
// But only, if it was set previously.
- if ( $PrivKey != "" )
+ if ( $PrivKey != "" && $mangleKey )
{
$locale = Locales::getLocale( $blogSettings->getValue( "locale" ) );
- $tmp = trim($locale->tr("recaptcha_mangled_key"));
- if ( $tmp != "" && $tmp != "recaptcha_mangled_key" ) $PrivKey = $tmp;
+ $PrivKey = trim($locale->tr("recaptcha_mangled_key"));
}
// create a view and export the settings to the template
$this->setValue( "pluginEnabled", $pluginEnabled );
$this->setValue( "PubKey" , $PubKey );
$this->setValue( "PrivKey" , $PrivKey );
-
+ $this->setValue( "mangleKey" , $mangleKey );
+ $this->setValue( "theme" , $theme );
+
parent::render();
}
}
Modified: plugins/branches/lifetype-1.2/recaptcha/library/recaptchalib.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/library/recaptchalib.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/library/recaptchalib.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -122,9 +122,9 @@
return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
<noscript>
- <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br>
+ <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
- <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
+ <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>';
}
@@ -146,9 +146,10 @@
* @param string $remoteip
* @param string $challenge
* @param string $response
+ * @param array $extra_params an array of extra variables to post to the server
* @return ReCaptchaResponse
*/
-function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response)
+function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
{
if ($privkey == null || $privkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
@@ -174,7 +175,7 @@
'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
- )
+ ) + $extra_params
);
$answers = explode ("\n", $response [1]);
Modified: plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/locale/locale_de_DE.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -15,10 +15,10 @@
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["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). Der gespeicherte Schlüssel wird zur Sicherheit nicht im Klartext angezeigt.";
+$messages["recaptcha_privatekey"] = "Privater ReCaptcha-Schlüssel (private key). ";
$messages["recaptcha_pubkey"] = "Öffentlicher ReCaptcha-Schlüssel (public key)";
$messages["recaptcha_type_code"] = "Bitte Captcha lösen (erforderlich)";
@@ -26,12 +26,21 @@
$messages["label_enable"] = "Aktivieren";
$messages["label_pubkey"] = "Öffentlicher ReCaptcha-Schlüssel";
$messages["label_privkey"] = "Privater ReCaptcha-Schlüssel";
+$messages["label_manglekey"] = "Privater ReCaptcha-Schlüssel maskieren";
+$messages["recaptcha_do_mangle"] = "Der gespeicherte Schlüssel wird zur Sicherheit nicht im Klartext angezeigt.";
$messages["recaptcha_error_key"] = "Fehler: Öffentlicher oder Privater Schlü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_pkeywarning" ]= "<br/>WARNUNG: Es ist konfiguriert, dass der Schlüssel nur maskiert ausgeben wird. Eine Änderung kann eventuell nur vom Administrator rückgängig gemacht werden und ist i.d.R nur notwendig, wenn ein eigener Site-Key benötigt wird.";
+
+$messages["label_theme"] ="ReCaptcha Theme";
+$messages["recaptcha_theme"] ="Hier wird der verwendete Theme eingestellt. Möiche Werte sind: 'red' (Standard), 'white', 'blackglass', 'clean' und 'custom'. 'Custom' muss durch Code im eigenen Template spezifiziert werden, wie unter http://recaptcha.net/apidocs/captcha/client.html beschrieben. Screenshots:
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_red.png\">red</a>,
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_white.png\">white</a>,
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_blackglass.png\">blackglass</a> und
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_clean.png\">clean</a>";
+
+/* this string is displayed as a replacement for the secret key in the configuration dialog.*/
$messages["recaptcha_mangled_key"] ="***";
$messages["recaptcha_settings_saved_ok"] = "ReCaptcha Einstellungen erfolgreich gespeichert.";
Modified: plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/locale/locale_en_UK.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -15,10 +15,10 @@
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["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. (The saved key is not shown to keep it secret.)";
+$messages["recaptcha_privatekey"] = "Your ReCaptcha private key.";
$messages["recaptcha_pubkey"] = "Your ReCaptcha public key";
$messages["recaptcha_type_code"] = "Please solve the puzzle (required)";
@@ -26,12 +26,21 @@
$messages["label_enable"] = "Enable";
$messages["label_pubkey"] = "ReCaptcha Public Key";
$messages["label_privkey"] = "ReCaptcha Private Key";
+$messages["label_manglekey"] = "Mask out private key in user Settings";
+$messages["recaptcha_do_mangle"] = "The saved private key will not displayed to users in their blog settings.";
$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_pkeywarning" ]= "<br/>WARNING: The private key is configured to be hidden. Do not change it unless you need your own site key or you might end up in a situation where you cannot recover without the help of your administrator.";
+
+$messages["label_theme"] ="ReCaptcha Theme";
+$messages["recaptcha_theme"] ="Specify the theme you want to use. Pre-defined are: 'red' (default), 'white', 'blackglass', 'clean' and 'custom'. 'Custom' needs some more work in your templates. See http://recaptcha.net/apidocs/captcha/client.html for details. Screenshots:
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_red.png\">red</a>,
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_white.png\">white</a>,
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_blackglass.png\">blackglass</a> and
+<a href=\"http://www.coldtobi.de/rc_ex/recaptcha_clean.png\">clean</a>";
+
+/* this string is displayed as a replacement for the secret key in the configuration dialog. */
$messages["recaptcha_mangled_key"] ="***";
$messages["recaptcha_settings_saved_ok"] = "ReCaptcha Settings saved successfully.";
Modified: plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/pluginrecaptcha.class.php 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,7 +1,6 @@
<?php
+ /* Copyright 2007, 2008 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
@@ -25,18 +24,20 @@
var $pluginEnabled;
var $PubKey;
var $PrivKey;
-
+ var $MangleKey;
+ var $Theme;
+ private $recaptcha_locales = array( "en","nl","fr","de","pt","ru","es","tr" );
+
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->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/1_coldtobis_blog/archive/128_recaptcha_plugin.html\"> http://blog.coldtobi.de/1_coldtobis_blog/archive/128_recaptcha_plugin.html</a>";
$this->author = "Tobias Frost";
$this->locales = Array( "en_UK","de_DE" );
- $this->version = "20080104";
+ $this->version = "20080401";
-
if( $source == "admin" )
$this->initAdmin();
else
@@ -64,14 +65,39 @@
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" );
+ $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" );
+ $this->MangleKey = $blogSettings->getValue( "plugin_recaptcha_manglekey" );
+ $this->Theme = $blogSettings->getValue( "plugin_recaptcha_theme" );
}
function show() {
- $result = recaptcha_get_html ($this->PubKey) . "<p style=\"font-size:6pt;padding-left:2em;width:500px;\"> <a href=\"http://blog.coldtobi.de\">This is the ReCaptcha Plugin for Lifetype </a></p>";
+
+ $result="<!-- thank you for using ReCaptcha for Lifetype coldtobi -->";
+ $jsoptions="";
+
+ if ( $this->Theme != "" )
+ {
+ $jsoptions = $jsoptions . "theme : '".$this->Theme . "' ";
+ }
+
+ $blogSettings = $this->blogInfo->getSettings();
+ $lang = $blogSettings->getValue( "locale" );
+ $lang=strtok($lang,"_");
+
+ if ( $lang != "" && in_array($lang, $this->recaptcha_locales) )
+ {
+ $jsoptions = $jsoptions . ", lang : '". $lang . "' ";
+ }
+
+ if ( $jsoptions != "" )
+ {
+ $result= $result ."<script> var RecaptchaOptions = { ". $jsoptions . "};</script>";
+ }
+
+ $result = $result . recaptcha_get_html ($this->PubKey) . "<p style=\"font-size:6pt;padding-left:2em;width:500px;\"> <a href=\"http://blog.coldtobi.de\">This is the ReCaptcha Plugin for Lifetype </a></p>";
return $result;
}
@@ -87,10 +113,10 @@
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 )));
+ Array( "name" => "plugin_recaptcha_privkey", "validator" => new StringValidator(), "type" => "string", "allowEmpty" => true ),
+ Array( "name" => "plugin_recaptcha_pubkey", "validator" => new StringValidator(), "type" => "string", "allowEmpty" => true ),
+ Array( "name" => "plugin_recaptcha_theme", "validator" => new StringValidator(), "type" => "string", "allowEmpty" => true ),
+ Array( "name" => "plugin_recaptcha_manglekey", "type" => "boolean" )));
}
-
}
?>
Modified: plugins/branches/lifetype-1.2/recaptcha/readme.txt
===================================================================
--- plugins/branches/lifetype-1.2/recaptcha/readme.txt 2008-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/readme.txt 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,10 +1,10 @@
Plugin: ReCaptcha
Author: Tobias Frost (blog.coldtobi.de)
-Release Date: 2007/11/20
+See changelog for version history.
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
+http://blog.coldtobi.de/1_coldtobis_blog/archive/128_recaptcha_plugin.html
LICENSE
========
@@ -39,7 +39,16 @@
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.
+IMPORTANT:
+A change in (Apr 2008) now offers to hide a site-wide API Key from blog users via blog settings.
+This option is now configurable in the global blog settings and cannot be changed by blog users.
+The Option is called "plugin_recaptcha_manglekey" and should be enabled to hide the keys.
+(This option should be note overrideable by your users.)
+IF YOU ARE UPDATING FROM A PRIOR VERSION, MAKE SURE TO UPDATE YOUR SETTINGS OR YOUR KEY MIGHT
+BE EXPOSED TO BLOG OWNERS.
+
+
MOTIVATION, FEEDBACK
=====================
Some time ago, I stumbled upon ReCaptcha.
@@ -61,18 +70,40 @@
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>
+CONFIGURATON HINTS
+==================
+
+Szenario "One domain for all blogs"
+
+In this case you need a site key for "yourdomain.tld". You want to enter that key in lifetype's
+global configuration and disable any overrides from your users to prevent them locking themself out of recaptcha.
+("User cannot override"). Enable "plugin_recaptcha_manglekey" to protect your key.
+
+Szenario "Different domains for the blogs."
+
+The users have to obtain the keys and enter them in their blog settings. Make sure that your users can overide
+the settings.
+
+Szenario "Mixture of the above"
+
+(This szenario might be not possible with standard lifetype. I don't know if tha mixed mode can be configured)
+You need a site key for "yourdomain.tld" and enter this in your global configuration. Enable "plugin_recaptcha_manglekey" to protect your key but this time let the private and public keys be overrideable
+by your users. Instruct your users with the custom domains to get their own keys and enter them in their blog settings. Instruct the others not to touch the settings.
+
+(For best results, check it after installation: Maybe you have to modify some spacing, or the clearer div)
+
+{ ** Plugin_Recaptcha Code start. ** }
+{ ** VERSION plugin_recaptcha 1.10 ** }
+{if $recaptcha && $recaptcha->isEnabled()}
+ <div style="overflow:auto">
+ <label for="recaptcha" style="height:140px">{$locale->tr("recaptcha_type_code")}</label>
+ <div id=recaptcha style="border-bottom:0px;">
+ {$recaptcha->show()}
</div>
- {/if}
- { ** Plugin_Recaptcha Code end ** }
+ <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-04-06 16:56:46 UTC (rev 6298)
+++ plugins/branches/lifetype-1.2/recaptcha/templates/recaptcha.template 2008-04-06 20:11:52 UTC (rev 6299)
@@ -1,5 +1,22 @@
+{ * 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
+* }
+
{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=ReCaptcha title=$locale->tr("recaptcha_plugin")}
+{include file="$admintemplatepath/navigation.template" showOpt=ReCaptcha title=$locale->tr("plugin_recaptcha")}
<form name="recaptchapluginConfig" action="admin.php" method="post">
<fieldset class="inputField">
@@ -13,22 +30,27 @@
</div>
</div>
- <div class="field">
- <label for="label_pubkey">{$locale->tr("label_pubkey")}</label>
+<div class="field">
+ <label for="Theme">{$locale->tr("label_theme")}</label>
+ <div class="formHelp">{$locale->tr("recaptcha_theme")}</div>
+ <input class="text" type="text" name="theme" id="theme" value="{$theme}" {user_cannot_override key=plugin_recaptcha_theme}readonly="readonly"{/user_cannot_override} />
+</div>
+
+<div class="field">
+ <label for="PubKey">{$locale->tr("label_pubkey")}</label>
<span class="required">*</span>
<div class="formHelp">{$locale->tr("recaptcha_pubkey")}</div>
<input class="text" type="text" name="PubKey" id="PubKey" value="{$PubKey}" {user_cannot_override key=plugin_recaptcha_pubkey}readonly="readonly"{/user_cannot_override} />
- </div>
+</div>
- <div class="field">
- <label for="label_privkey">{$locale->tr("label_privkey")}</label>
+<div class="field">
+ <label for="PrivKey">{$locale->tr("label_privkey")}</label>
<span class="required">*</span>
- <div class="formHelp">{$locale->tr("recaptcha_privatekey")}</div>
+ <div class="formHelp">{$locale->tr("recaptcha_privatekey")}{if $mangleKey} {$locale->tr("recaptcha_pkeywarning")} {/if} </div>
<input class="text" type="text" name="PrivKey" id="PrivKey" value="{$PrivKey}" {user_cannot_override key=plugin_recaptcha_privkey}readonly="readonly"{/user_cannot_override} />
</div>
+ </fieldset>
- </fieldset>
-
<div class="buttons">
<input type="hidden" name="op" value="updateRecaptchaConfig" />
<input type="reset" name="{$locale->tr("reset")}" />
More information about the pLog-svn
mailing list