File: phpbb/cron/task/core/update_hashes.php
Unmodified
Added
Modified
Removed
Line 56 | Line 56 |
---|
foreach ($defaults as $type) {
|
foreach ($defaults as $type) {
|
if ($hashing_algorithms[$type]->is_supported())
| if ($hashing_algorithms[$type]->is_supported() && !$hashing_algorithms[$type] instanceof \phpbb\passwords\driver\base_native)
|
{ $this->default_type = $type; break;
| { $this->default_type = $type; break;
|
Line 106 | Line 106 |
---|
while ($row = $this->db->sql_fetchrow($result)) {
|
while ($row = $this->db->sql_fetchrow($result)) {
|
$new_hash = $this->passwords_manager->hash($row['user_password'], array($this->default_type));
| $old_hash = preg_replace('/^\$CP\$/', '', $row['user_password']);
// If stored hash type is unknown then it's md5 hash with no prefix // First rehash it using $H$ as hash type identifier (salted_md5) if (!$this->passwords_manager->detect_algorithm($old_hash)) { $old_hash = $this->passwords_manager->hash($old_hash, '$H$'); }
$new_hash = $this->passwords_manager->hash($old_hash, [$this->default_type]);
|
// Increase number so we know that users were selected from the database $affected_rows++;
| // Increase number so we know that users were selected from the database $affected_rows++;
|