Keys module give an api to manage keys by domains. I make a patch so recaptcha use it.
Thanks to that, i can manage multiple keys for a site wich use mysite.com for english site and monsite.fr for french site.

Comments

goz’s picture

Version: 6.x-1.7 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new5.63 KB

Here si the patch (Should use same way to mailhide module)

Does this seems correct to you ?

robloach’s picture

Status: Needs review » Needs work

I like it a lot! :-)

+++ b/recaptcha.admin.incundefined
@@ -13,22 +13,38 @@ function recaptcha_admin_settings() {
+      '#type' => 'item',
+      '#title' => t('Public Key'),
+      '#description' => t('The public key given to you when you <a href="@url" target="_blank">registered at reCAPTCHA.net</a>.', array('@url' => url(recaptcha_get_signup_url($_SERVER['SERVER_NAME'], variable_get('site_name', ''))))),
+      '#value' => t('Managed by <a href="@url">Keys</a>.', array('@url' => url('admin/settings/keys'))),

Instead of having it as a value, could we have it so that the textfield becomes disabled, and the description gets replaced about Keys being used?

+++ b/recaptcha.moduleundefined
@@ -171,8 +187,8 @@ function recaptcha_captcha_validation($solution = NULL, $response = NULL) {
     $resp = recaptcha_check_answer(
-      variable_get('recaptcha_private_key', ''),
-      ip_address(),
+      _recaptcha_get_key('private'),
+      $user->hostname,
       $_POST['recaptcha_challenge_field'],
       $_POST['recaptcha_response_field']

Is the ip_address() change needed?

robloach’s picture

Also, is there going to be a Drupal 7 stable version of Keys module anytime soon? I'd like to keep the reCAPTCHA branches as close as possible.

goz’s picture

Yes it's possible to have textfield (disabled) instead of #item (see patch)
ip_address() change isn't needed (sorry for this copy/paste error)

I don't know if keys module will have a stable version soon (i'm only user of it). But it's seems to be under development regardless to issues (less than one month). But no commits since 4 months...

jberg1’s picture

This worked great for me.
Using Drupal 6.22, Keys 6x-2.1, and ReCAPTCHA 6x-1.7 (+ your patch)

Thank you!
Great timing. I moved a site live today and needed this to fix the issue.
And it plays nicely along side GMap using Keys also.

hass’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Keys is not maintained