Initial login when first turning module on

xxvelcrar - July 18, 2008 - 22:19
Project:Webserver authentication
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

When the module is first turned on and an existing user account has the same name as the authenticated account, there's a SQL error:

user warning: Duplicate entry 'username' for key 2 query: INSERT INTO users (name, pass, init, status, uid, created, access) VALUES ('username', '6a11535ba4971a378391776a9db629d3', 'username', 1, 34, 1216419272, 1216419272) in /usr/share/drupal5/includes/database.mysqli.inc on line 151.

Which comes about from user_save() being called with the same username as an existing user. For some reason, an entry is added into the authmap with a uid of 0.

The attached patch looks to see if a user exists in the system already before it creates a new account. If it exists, it adds the appropriate authmap entry for that user instead of creating a new user.

AttachmentSize
webserver_auth_first_time.patch2.39 KB

#1

xxvelcrar - July 18, 2008 - 22:20
Version:5.x-0.0-rc1» 5.x-1.x-dev
 
 

Drupal is a registered trademark of Dries Buytaert.