mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 08:20:57 +01:00
abc030fa00
Summary: Ref T13043. This moves user account passwords to the new shared infrastructure. There's a lot of code changes here, but essentially all of it is the same as the VCS password logic in D18898. Test Plan: - Ran migration. - Spot checked table for general sanity. - Logged in with an existing password. - Hit all error conditions on "change password", "set password", "register new account" flows. - Verified that changing password logs out other sessions. - Verified that revoked passwords of a different type can't be selected. - Changed passwords a bunch. - Verified that salt regenerates properly after password change. - Tried to login with the wrong password, which didn't work. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13043 Differential Revision: https://secure.phabricator.com/D18903
24 lines
572 B
PHP
24 lines
572 B
PHP
<?php
|
|
|
|
// Populate VCS passwords (which we copied from the old "VCS Password" table
|
|
// in the last migration) with new PHIDs.
|
|
|
|
$table = new PhabricatorAuthPassword();
|
|
$conn = $table->establishConnection('w');
|
|
|
|
$password_type = PhabricatorAuthPasswordPHIDType::TYPECONST;
|
|
|
|
foreach (new LiskMigrationIterator($table) as $row) {
|
|
if (phid_get_type($row->getPHID()) == $password_type) {
|
|
continue;
|
|
}
|
|
|
|
$new_phid = $row->generatePHID();
|
|
|
|
queryfx(
|
|
$conn,
|
|
'UPDATE %T SET phid = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
$new_phid,
|
|
$row->getID());
|
|
}
|