mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
799dada3ad
Summary: Ref T5952. This adds support for a "default author" and deploys it on Maniphest. Test Plan: used augmented (by this diff) bin/mail receive-test to test creation via an application email with a default author configured and no author specified. a task was created with the author as the default author i configured. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T5952 Differential Revision: https://secure.phabricator.com/D11446
22 lines
650 B
PHP
22 lines
650 B
PHP
<?php
|
|
|
|
$key = 'metamta.maniphest.default-public-author';
|
|
echo "Migrating `$key` to new application email infrastructure...\n";
|
|
$value = PhabricatorEnv::getEnvConfigIfExists($key);
|
|
$maniphest = new PhabricatorManiphestApplication();
|
|
$config_key =
|
|
PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR;
|
|
|
|
if ($value) {
|
|
$app_emails = id(new PhabricatorMetaMTAApplicationEmailQuery())
|
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
|
->withApplicationPHIDs($maniphest->getPHID())
|
|
->execute();
|
|
|
|
foreach ($app_emails as $app_email) {
|
|
$app_email->setConfigValue($config_key, $value);
|
|
$app_email->save();
|
|
}
|
|
}
|
|
|
|
echo "Done.\n";
|