Client installed webserver_auth and got the following errors on new account creation:
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /u1/www/html/includes/database.inc on line 253.
* warning: implode() [function.implode]: Bad arguments. in /u1/www/html/includes/database.inc on line 253.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /u1/www/html/modules/user/user.module on line 502.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /u1/www/html/modules/user/user.module on line 502.
I was able to reproduce the issue in our staging environment and discovered that upon entry to webserver_auth_init(), the global $user variable had partial information on the last account the user used to log in. Patch below unsets $user before trying to log in so Drupal is forced to load fresh user data.
Comment | File | Size | Author |
---|---|---|---|
#1 | webserver_auth_force_user_reload.patch | 309 bytes | csixty4 |
Comments
Comment #1
csixty4 CreditAttribution: csixty4 commentedPatch somehow got lost in all the previews & edits
Comment #2
wimvds CreditAttribution: wimvds commentedThis seemed to work at first, but I ran into some problems afterwards, so I guess it doesn't really fix it. I'm trying to figure it out now.
Comment #3
alexanderrozenson CreditAttribution: alexanderrozenson commentedDid you managed to solve this issue? I'm using NTLM and refreshing the page helps to sign. It happens once only in the first log-in but still annoying
Comment #4
Magilla CreditAttribution: Magilla commentedI'm getting virtually the same thing:
As far as I can tell, it's to do with having the Profile module on together with the Webserver Authentication.
Comment #5
alexanderrozenson CreditAttribution: alexanderrozenson commentedDisabling profile module doesnt solve the issues and I still see this error messages
Comment #6
teezee CreditAttribution: teezee commentedIt might be cleaner to use:
instead of just unsetting $user:
because there are some modules/functions that check for the value of $user->uid, and that might throw an warning/notice when $user is not even set.
Comment #7
boilermaker.jb1 CreditAttribution: boilermaker.jb1 commentedI apologize in the delay responding to this issue. I agree this would be a cleaner way to do it. I will look into what drupal_anonymous_user() does and see about publishing a dev release.
Comment #8
Nor4a CreditAttribution: Nor4a commented#1 Fixed the problem if the user was already registered in the DRUPALS database, but if user was comming from $_SERVER['REMOTE_USER'] variable, the login successful was for the first time (when account was created), but when the user tries to access the site again - auto init fails.
Fix for users which were registered in the DRUPAL database as usual users, problem fixed with adding a record for each user to the {authmap} table - e.g. for ADMIN user it is like this: INSERT INTO {authmap}(uid,authname,module) VALUES (1,admin,webserver_auth);
Comment #9
Eaglecanada CreditAttribution: Eaglecanada commentedI am still getting the error. What's the solution? not quite get Nor4a 's method.
use Version: 6.x-1.0
Comment #10
gaards CreditAttribution: gaards commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.