Closed (fixed)
Project:
Conference Organizing Distribution
Version:
6.x-1.0-alpha2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2012 at 15:50 UTC
Updated:
20 Jul 2012 at 13:41 UTC
Comments
Comment #1
PeterCorless commentedApparently it is, but it's not easy. You have to edit this file:
{drupal}/modules/user/user.module
Within that file, there is a section which checks for duplicates:
// Validate the e-mail address, and check if it is taken by an existing user.
if ($error = user_validate_mail($form_state['values']['mail'])) {
form_set_error('mail', $error);
}
elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($form_state['values']['mail']), 'LIKE')->range(0, 1)->execute()->fetchField()) {
// Format error message dependent on whether the user is logged in or not.
if ($GLOBALS['user']->uid) {
form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail'])));
}
else {
form_set_error('mail', t('The e-mail address %email is already registered. Have you forgotten your password?', array('%email' => $form_state['values']['mail'], '@password' => url('user/password'))));
}
}
I am not a PHP guru, but somewhere, in the "elseif" statement, you need to edit that or comment it out, so that it does not check for it to be a duplicate. I am doing a new install and have similar issues, so I will monkey around with it and let you know.
edit: The "else" line seems to also have to be edited out too. I tried it, and must have made a syntax error, because my whole site errored out when I first tried to comment it away. (Good thing I backed up the original file!)
Comment #2
PeterCorless commentedAlright... I tried it and tested it. This seems to now work:
// Commenting out this section to allow a user to register more than once with the same email address. petercorless 30 Jun 2012
// elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($form_state['values']['mail']), 'LIKE')->range(0, 1)->execute()->fetchField()) {
// Format error message dependent on whether the user is logged in or not.
// if ($GLOBALS['user']->uid) {
// form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail'])));
// }
// else {
// form_set_error('mail', t('The e-mail address %email is already registered. Have you forgotten your password?', array('%email' => $form_state['values']['mail'], '@password' => url('user/password'))));
// }
//}
YMMV. I have not done any sort of extensive testing. For instance, I have no idea if any other administrative or reporting functions may barf when they see more than one user with the same email address. But it basically allows you to do what you wished. Enjoy!
-Peter Corless.
Comment #3
gregglesI don't think this is really possible/supportable in COD directly, at least not in 6.x.
There's a longstanding issue in #349228: Signup anonymous users without email for the signup module that would need to be fixed first and that's quite unlikely.
The suggestions in #1 and #2 are for hacking core which is generally not appropriate, so I don't suggest others head down that road.
You could achieve similar results by disabling signup and converting the signup process to instead rely on product purchases or something like that. Marking "fixed" as a support request, but if you feel this should be re-opened please do it.