2013-05-08 11:38:07 +02:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Populating Releeph requests with mail keys...')."\n";
|
2013-05-08 11:38:07 +02:00
|
|
|
|
|
|
|
$table = new ReleephRequest();
|
|
|
|
$table->openTransaction();
|
|
|
|
|
|
|
|
// From ponder-mailkey-populate.php...
|
|
|
|
foreach (new LiskMigrationIterator($table) as $rq) {
|
|
|
|
$id = $rq->getID();
|
|
|
|
|
|
|
|
echo "RQ{$id}: ";
|
|
|
|
if (!$rq->getMailKey()) {
|
|
|
|
queryfx(
|
|
|
|
$rq->establishConnection('w'),
|
|
|
|
'UPDATE %T SET mailKey = %s WHERE id = %d',
|
|
|
|
$rq->getTableName(),
|
|
|
|
Filesystem::readRandomCharacters(20),
|
|
|
|
$id);
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Generated Key')."\n";
|
2013-05-08 11:38:07 +02:00
|
|
|
} else {
|
|
|
|
echo "-\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->saveTransaction();
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|