1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00
phorge-phorge/resources/sql/patches/legalpad-mailkey-populate.php
Bob Trahan 2c03cd931b Legalpad V0.2 - add mail integration
Summary:
Supports !unsubscribe and commenting on replies. Subscribers get mailed something reasonable. Fixes T3480.

Sneaks in /LX/ support. In the near future I want to have that /LX/ be a clean "signature" page sans all the edit actions and other fluff... Will resolve this as part of T3481.

Test Plan: used the metamta console to add comments and unsubscribe. added a phlog() inside mail code to verify mail bodies looked okay.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3480

Differential Revision: https://secure.phabricator.com/D6369
2013-07-03 16:37:05 -07:00

25 lines
575 B
PHP

<?php
echo "Populating Legalpad Documents with mail keys...\n";
$table = new LegalpadDocument();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $document) {
$id = $document->getID();
echo "Document {$id}: ";
if (!$document->getMailKey()) {
queryfx(
$document->establishConnection('w'),
'UPDATE %T SET mailKey = %s WHERE id = %d',
$document->getTableName(),
Filesystem::readRandomCharacters(20),
$id);
echo "Generated Key\n";
} else {
echo "-\n";
}
}
$table->saveTransaction();
echo "Done.\n";