mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
36e2d02d6e
Summary: `pht`ize a whole bunch of strings in rP. Test Plan: Intense eyeballing. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12797
27 lines
728 B
PHP
27 lines
728 B
PHP
<?php
|
|
|
|
$table = new PhabricatorRepositoryVCSPassword();
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
echo pht('Upgrading password hashing for VCS passwords.')."\n";
|
|
|
|
$best_hasher = PhabricatorPasswordHasher::getBestHasher();
|
|
foreach (new LiskMigrationIterator($table) as $password) {
|
|
$id = $password->getID();
|
|
|
|
echo pht('Migrating VCS password %d...', $id)."\n";
|
|
|
|
$input_hash = $password->getPasswordHash();
|
|
$input_envelope = new PhutilOpaqueEnvelope($input_hash);
|
|
|
|
$storage_hash = $best_hasher->getPasswordHashForStorage($input_envelope);
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET passwordHash = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
$storage_hash->openEnvelope(),
|
|
$id);
|
|
}
|
|
|
|
echo pht('Done.')."\n";
|