Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Code to get password history from database:
$query = db_select('password_policy_history', 'p');
$query
->condition('p.uid', array_keys($accounts))
->fields('p', array('uid', 'pass', 'created'))
->orderBy('created', 'DESC');
foreach ($query->execute() as $record) {
$accounts[$record->uid]->password_history[] = $record;
}
The order will be unspecified for multiple passwords submitted in same second.
This affects automated tests where multiple password changes may happen in the same second.
Comment | File | Size | Author |
---|---|---|---|
#1 | password_policy-7.x-2.x-fix_history_order-2455045-1.patch | 500 bytes | AohRveTPV |
Comments
Comment #1
AohRveTPV CreditAttribution: AohRveTPV commentedComment #3
AohRveTPV CreditAttribution: AohRveTPV commented