mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/13225] Use passwords manager instead of phpbb_hash in migration
PHPBB3-13225
This commit is contained in:
parent
51251293ab
commit
6cc5160d60
1 changed files with 4 additions and 1 deletions
|
@ -55,6 +55,9 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
|
||||||
|
|
||||||
public function hash_old_passwords()
|
public function hash_old_passwords()
|
||||||
{
|
{
|
||||||
|
global $phpbb_container;
|
||||||
|
|
||||||
|
$passwords_manager = $phpbb_container->get('passwords.manager');
|
||||||
$sql = 'SELECT user_id, user_password
|
$sql = 'SELECT user_id, user_password
|
||||||
FROM ' . $this->table_prefix . 'users
|
FROM ' . $this->table_prefix . 'users
|
||||||
WHERE user_pass_convert = 1';
|
WHERE user_pass_convert = 1';
|
||||||
|
@ -65,7 +68,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
|
||||||
if (strlen($row['user_password']) == 32)
|
if (strlen($row['user_password']) == 32)
|
||||||
{
|
{
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
'user_password' => phpbb_hash($row['user_password']),
|
'user_password' => $passwords_manager->hash($row['user_password'], 'passwords.driver.salted_md5'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']);
|
$this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']);
|
||||||
|
|
Loading…
Add table
Reference in a new issue