2014-04-10 11:45:10 -07:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Updating users...')."\n";
|
2014-04-10 11:45:10 -07:00
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator(new PhabricatorUser()) as $user) {
|
|
|
|
$id = $user->getID();
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Updating %d...', $id)."\n";
|
2014-04-10 11:45:10 -07:00
|
|
|
|
|
|
|
if (strlen($user->getAccountSecret())) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
queryfx(
|
|
|
|
$user->establishConnection('w'),
|
|
|
|
'UPDATE %T SET accountSecret = %s WHERE id = %d',
|
|
|
|
$user->getTableName(),
|
|
|
|
Filesystem::readRandomCharacters(64),
|
|
|
|
$id);
|
|
|
|
}
|
|
|
|
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Done.')."\n";
|