Commit 307998f2 authored by joe's avatar joe Committed by lucha

adding a define for the global public and private recaptcha keys.

- Fix all blogs that have an empty recaptcha key.
- require configuration for wp-recaptcha (to define the global keys)
parent ed08c061
......@@ -11,6 +11,7 @@
* @link http://www.google.com/recaptcha
*/
require_once('config.php');
require_once('wp-plugin.php');
if (class_exists('ReCAPTCHAPlugin'))
......@@ -115,8 +116,8 @@ class ReCAPTCHAPlugin extends WPPlugin
$option_defaults = array();
$old_options = WPPlugin::retrieve_options("recaptcha");
if ($old_options) {
$option_defaults['site_key'] = $old_options['pubkey'];
$option_defaults['secret'] = $old_options['privkey'];
$option_defaults['site_key'] = $old_options['pubkey'] ? $old_options['pubkey'] : GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = $old_options['privkey'] ? $old_options['privkey'] : GLOBAL_RECAPTCHA_PRIVATE_KEY;
// styling
$option_defaults['recaptcha_language'] = $old_options['re_lang'];
......@@ -126,14 +127,14 @@ class ReCAPTCHAPlugin extends WPPlugin
} else {
$old_options = WPPlugin::retrieve_options($this->options_name);
if ($old_options) {
$option_defaults['site_key'] = $old_options['public_key'];
$option_defaults['secret'] = $old_options['private_key'];
$option_defaults['site_key'] = $old_options['public_key'] ? $old_options['pubkey'] : GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = $old_options['private_key'] ? $old_options['privkey'] : GLOBAL_RECAPTCHA_PRIVATE_KEY;
$option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = $old_options['recaptcha_language'];
$option_defaults['no_response_error'] = $old_options['no_response_error'];
} else {
$option_defaults['site_key'] = '';
$option_defaults['secret'] = '';
$option_defaults['site_key'] = GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = GLOBAL_RECAPTCHA_PRIVATE_KEY;
$option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = 'en';
$option_defaults['no_response_error'] =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment