2013-05-08 11:38:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
echo "Populating Releeph requests with mail keys...\n";
|
|
|
|
|
|
|
|
$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);
|
2014-09-08 02:03:19 +02:00
|
|
|
echo "Generated Key\n";
|
2013-05-08 11:38:07 +02:00
|
|
|
} else {
|
|
|
|
echo "-\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->saveTransaction();
|
|
|
|
echo "Done.\n";
|