Captcha on user_registration conflicts with OpenID auto-registration
bdurbin - April 3, 2008 - 01:30
| Project: | OpenID |
| Version: | HEAD |
| Component: | OpenID Client |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
If captcha is installed and enabled for the user_register form, auto-registration will fail due to the captcha not being solved.
A patch is attached as one possible way to solve the issue.
Steps to reproduce the issue:
1. Install Captcha
2. Install OpenID
3. Enable captcha on User Registration Form
4. Attempt OpenID registration via /user/register
Between making captcha openID-aware and making this module captcha-aware, this seems like the more direct route.
| Attachment | Size |
|---|---|
| openid-captchafix.patch | 610 bytes |

#1
A follow-up to the above: The decision to patch on OpenID as opposed to Captcha also takes advantage of the current relative hook execution order between the two modules.
#2
#3
I try the patch, but I got "Hunk #1 FAILED at 467" on Drupal 6.4.
I re-implement the changes (patch attached) but OpenID registration failed.
#4
FWIW, those needing quick resolution can do this with a custom form_alter like so:
<?phpfunction hook_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_register' && $_GET['q'] == 'openid/authenticate') {
unset($form['captcha']);
}
}
?>
#5
Just another bonus, I had a similar problem w/logintoboggan's desire to validate a "confirm email address" field. Here's a fix to both this and captcha:
<?phpfunction hook_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_register' && $_GET['q'] == 'openid/authenticate') {
if (module_exists('captcha')) {
unset($form['captcha']);
}
if (module_exists('logintoboggan')) {
foreach($form['#validate'] as $key => $function) {
if ($function == 'logintoboggan_user_register_validate') {
unset($form['#validate'][$key]);
}
}
}
}
}
?>
Happy Drupaling!