Posted by randall.vg on August 14, 2008 at 12:56pm
3 followers
Jump to:
| Project: | Drupal core |
| Version: | 5.x-dev |
| Component: | user.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
When a module implements hook_auth to authenticate an existing user, the user_authentication function returns an user object with the wrong values iow it doesn't load the right user.
On line 1009 the user is loaded into $user_register, which calls user_save() when a user doesn't exist yet. This way, the $user object will get filled. However, if the user already exists (thus, it has an uid) the user object remains filled with the 'anonymous' user values, because the lack of an else statement.
This issue exists after commit #100096 by drumm at February 10, 2008 04:28 (Rev. 1.745.2.27)
The patch provided will fix this issue in 5.x-dev.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| 20080814-user-authenticate.patch | 669 bytes | Ignored: Check issue status. | None | None |
Comments
#1
Marking #287503: Passwords module not authenticating users as a duplicate of this.
I've also tested this patch and it works fine. Am marking reviewed and tested, as it's only a three line change and looks good, string me up if I'm wrong. ;-)
#2
The behavior is by design: existing users can only be authenticated if they are in the authentication map.
Please see #283026: user_authenticate from external source (for existing users) not working with no server part.