Closed (fixed)
Project:
Email Registration
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2010 at 18:39 UTC
Updated:
28 Apr 2010 at 17:20 UTC
Because name is generated in hook_form_alter and then replaced in hook_user when user_register_submit is triggered on form submit the username is still the random value. This random value is passed to user_authenticate after hook_user is triggered. As a result the user can never be authenticated. Instead of generating the username in hook_user I would recommend adding a submit handler to the user_register form with array_unshift to have it happen before user_register_submit and setting $form_state['values']['name'] there. Then you won't have to use hook_user at all.
Comments
Comment #1
sp3boy commentedThis looks like a serious issue, so I just tried replicating the situation, but could not generate a problem. I ended up with a user id of "lkoqumrzkj" for my user with name "john" and can log in and out with the email address. No confirmation email was used.
Can you suggest a step-by-step test to demonstrate what you think is wrong in practice please?
Comment #2
wwhurley commentedAhhh... I see what happened. Between installation of the module and writing this ticket another version was released and I wasn't paying close enough attention. 6.x-1.3 fixes the issue, as described in the notes. Sorry about that.