errors when defaulting to md5 authentication method.
| Project: | Secure Password Hashes (phpass) |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | fixed |
I can't log in as admin on my test system atm due to this. (not too serious for me as I have no data on the test system).
Steps:
1. Install the module.
2. Set hash method to md5.
Now with users who still have a phpass has can log in (and the hash will be converted to an md5), but if a user only has an md5 hash, the following error messages are given:
* Sorry, unrecognized username or password. Have you forgotten your password?
* warning: array_fill() [function.array-fill]: Number of elements must be positive in C:\wamp\www\drupal-6.3\includes\database.inc on line 240.
* warning: implode() [function.implode]: Invalid arguments passed in C:\wamp\www\drupal-6.3\includes\database.inc on line 240.
* warning: array_keys() [function.array-keys]: The first argument should be an array in C:\wamp\www\drupal-6.3\modules\user\user.module on line 514.
* 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 C:\wamp\www\drupal-6.3\modules\user\user.module on line 514.

#1
I managed to fix this by changing:
<?php// authenticate the standard Drupal way
return user_authenticate($user, $pass);;
?>
to
<?php
$form_state['values']['name'] = $user;
$form_state['values']['pass'] = $pass;
// authenticate the standard Drupal way
return user_authenticate($form_state['values']);
?>
It is a bit of a hack, but it works.
#2
This issue still exists.
#3
I had the same problem and had to reset admin password.
#4
If you made the above changes, that should have prevented the need to reset the password? Did the suggested changes work for you?
#5
I am ready to test a patch, but on which page? Can you create a patch please?
#6
#7
It's an omission made while porting from D5 to D6 (http://drupal.org/node/114774#user_authenticate), attached cleaned up patch.
#8
Committed - thanks!