2014-01-15 02:17:18 +01:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Adding secretkeys to legalpad document signatures.')."\n";
|
2014-01-15 02:17:18 +01:00
|
|
|
|
|
|
|
$table = new LegalpadDocumentSignature();
|
|
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
$iterator = new LiskMigrationIterator($table);
|
|
|
|
foreach ($iterator as $sig) {
|
|
|
|
$id = $sig->getID();
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Populating signature %d...', $id)."\n";
|
2014-01-15 02:17:18 +01:00
|
|
|
|
|
|
|
if (!$sig->getSecretKey()) {
|
|
|
|
queryfx(
|
|
|
|
$conn_w,
|
|
|
|
'UPDATE %T SET secretKey = %s WHERE id = %d',
|
|
|
|
$table->getTableName(),
|
|
|
|
Filesystem::readRandomCharacters(20),
|
|
|
|
$id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|