bin/accountadmin - allow creation of system accounts and create workflow for system accounts that are in trouble

Summary: the former is self explanatory. the latter is necessary for installations that require email verification. since many system agents are given bogus email address there can become a problem where these accounts can't be verified

Test Plan: created system agent account from scratch. edited user and toggled system agent accountness. created system agent with unverified email address and verified it.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1656

Differential Revision: https://secure.phabricator.com/D3401
This commit is contained in:
Bob Trahan
2012-08-29 11:07:29 -07:00
parent c52d66e5ba
commit cc0b74b01a
4 changed files with 103 additions and 13 deletions

View File

@@ -132,8 +132,9 @@ final class PhabricatorPeopleEditController
$request = $this->getRequest();
if ($request->isFormPost()) {
$welcome_checked = $request->getInt('welcome');
$is_new = !$user->getID();
if (!$user->getID()) {
if ($is_new) {
$user->setUsername($request->getStr('username'));
$new_email = $request->getStr('email');
@@ -147,9 +148,6 @@ final class PhabricatorPeopleEditController
$e_email = null;
}
if ($request->getStr('role') == 'agent') {
$user->setIsSystemAgent(true);
}
}
$user->setRealName($request->getStr('realname'));
@@ -172,7 +170,6 @@ final class PhabricatorPeopleEditController
if (!$errors) {
try {
$is_new = !$user->getID();
if (!$is_new) {
id(new PhabricatorUserEditor())
@@ -186,6 +183,13 @@ final class PhabricatorPeopleEditController
id(new PhabricatorUserEditor())
->setActor($admin)
->createNewUser($user, $email);
if ($request->getStr('role') == 'agent') {
id(new PhabricatorUserEditor())
->setActor($admin)
->makeSystemAgentUser($user, true);
}
}
if ($welcome_checked) {