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.

Files: 
CommentFileSizeAuthor
#7 phpass_ua.patch587 bytestacituseu
#6 phpass.patch641 bytesnbz

Comments

Status:Active» Needs review

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.

This issue still exists.

I had the same problem and had to reset admin password.

If you made the above changes, that should have prevented the need to reset the password? Did the suggested changes work for you?

I am ready to test a patch, but on which page? Can you create a patch please?

StatusFileSize
new641 bytes

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new587 bytes

It's an omission made while porting from D5 to D6 (http://drupal.org/node/114774#user_authenticate), attached cleaned up patch.

Status:Reviewed & tested by the community» Fixed

Committed - thanks!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.