Commit adad3927 authored by joe's avatar joe Committed by kiki

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 bc5f2598
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* @link http://www.google.com/recaptcha * @link http://www.google.com/recaptcha
*/ */
require_once('config.php');
require_once('wp-plugin.php'); require_once('wp-plugin.php');
if (class_exists('ReCAPTCHAPlugin')) if (class_exists('ReCAPTCHAPlugin'))
...@@ -115,8 +116,8 @@ class ReCAPTCHAPlugin extends WPPlugin ...@@ -115,8 +116,8 @@ class ReCAPTCHAPlugin extends WPPlugin
$option_defaults = array(); $option_defaults = array();
$old_options = WPPlugin::retrieve_options("recaptcha"); $old_options = WPPlugin::retrieve_options("recaptcha");
if ($old_options) { if ($old_options) {
$option_defaults['site_key'] = $old_options['pubkey']; $option_defaults['site_key'] = $old_options['pubkey'] ? $old_options['pubkey'] : GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = $old_options['privkey']; $option_defaults['secret'] = $old_options['privkey'] ? $old_options['privkey'] : GLOBAL_RECAPTCHA_PRIVATE_KEY;
// styling // styling
$option_defaults['recaptcha_language'] = $old_options['re_lang']; $option_defaults['recaptcha_language'] = $old_options['re_lang'];
...@@ -126,14 +127,14 @@ class ReCAPTCHAPlugin extends WPPlugin ...@@ -126,14 +127,14 @@ class ReCAPTCHAPlugin extends WPPlugin
} else { } else {
$old_options = WPPlugin::retrieve_options($this->options_name); $old_options = WPPlugin::retrieve_options($this->options_name);
if ($old_options) { if ($old_options) {
$option_defaults['site_key'] = $old_options['public_key']; $option_defaults['site_key'] = $old_options['public_key'] ? $old_options['pubkey'] : GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = $old_options['private_key']; $option_defaults['secret'] = $old_options['private_key'] ? $old_options['privkey'] : GLOBAL_RECAPTCHA_PRIVATE_KEY;
$option_defaults['comments_theme'] = 'standard'; $option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = $old_options['recaptcha_language']; $option_defaults['recaptcha_language'] = $old_options['recaptcha_language'];
$option_defaults['no_response_error'] = $old_options['no_response_error']; $option_defaults['no_response_error'] = $old_options['no_response_error'];
} else { } else {
$option_defaults['site_key'] = ''; $option_defaults['site_key'] = GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = ''; $option_defaults['secret'] = GLOBAL_RECAPTCHA_PRIVATE_KEY;
$option_defaults['comments_theme'] = 'standard'; $option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = 'en'; $option_defaults['recaptcha_language'] = 'en';
$option_defaults['no_response_error'] = $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