mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-11 08:06:13 +01:00
24 lines
519 B
PHP
24 lines
519 B
PHP
|
<?php
|
||
|
|
||
|
echo "Adding secretkeys to legalpad document signatures.\n";
|
||
|
|
||
|
$table = new LegalpadDocumentSignature();
|
||
|
$conn_w = $table->establishConnection('w');
|
||
|
$iterator = new LiskMigrationIterator($table);
|
||
|
foreach ($iterator as $sig) {
|
||
|
$id = $sig->getID();
|
||
|
|
||
|
echo "Populating signature {$id}...\n";
|
||
|
|
||
|
if (!$sig->getSecretKey()) {
|
||
|
queryfx(
|
||
|
$conn_w,
|
||
|
'UPDATE %T SET secretKey = %s WHERE id = %d',
|
||
|
$table->getTableName(),
|
||
|
Filesystem::readRandomCharacters(20),
|
||
|
$id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
echo "Done.\n";
|