mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16534] Add conversion prefix to all passwords that need conversion
PHPBB3-16534
This commit is contained in:
parent
47fcf3403f
commit
33306a0699
1 changed files with 8 additions and 2 deletions
|
@ -27,6 +27,12 @@ class passwords_convert_p1 extends \phpbb\db\migration\migration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update passwords with convert flag to have $CP$ prefix
|
||||||
|
*
|
||||||
|
* @param int $start Limit start value
|
||||||
|
* @return int|void Null if conversion is finished, next start value if not
|
||||||
|
*/
|
||||||
public function update_passwords($start)
|
public function update_passwords($start)
|
||||||
{
|
{
|
||||||
// Nothing to do if user_pass_convert column doesn't exist
|
// Nothing to do if user_pass_convert column doesn't exist
|
||||||
|
@ -51,8 +57,8 @@ class passwords_convert_p1 extends \phpbb\db\migration\migration
|
||||||
$converted_users++;
|
$converted_users++;
|
||||||
|
|
||||||
$user_id = (int) $row['user_id'];
|
$user_id = (int) $row['user_id'];
|
||||||
// Only prefix passwords without proper prefix
|
// Prefix all passwords that need to be converted
|
||||||
if (!isset($update_users[$user_id]) && !preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $row['user_password']))
|
if (!isset($update_users[$user_id]))
|
||||||
{
|
{
|
||||||
// Use $CP$ prefix for passwords that need to
|
// Use $CP$ prefix for passwords that need to
|
||||||
// be converted and set pass convert to false.
|
// be converted and set pass convert to false.
|
||||||
|
|
Loading…
Add table
Reference in a new issue