3 final class PhabricatorPeopleCreateController
4 extends PhabricatorPeopleController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $admin = $request->getUser();
9 id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession(
12 $this->getApplicationURI());
15 if ($request->isFormPost()) {
16 $v_type = $request->getStr('type');
18 if ($v_type == 'standard' ||
$v_type == 'bot' ||
$v_type == 'list') {
19 return id(new AphrontRedirectResponse())->setURI(
20 $this->getApplicationURI('new/'.$v_type.'/'));
24 $title = pht('Create New User');
26 $standard_caption = pht(
27 'Create a standard user account. These users can log in to Phabricator, '.
28 'use the web interface and API, and receive email.');
30 $standard_admin = pht(
31 'Administrators are limited in their ability to access or edit these '.
32 'accounts after account creation.');
35 'Create a bot/script user account, to automate interactions with other '.
36 'systems. These users can not use the web interface, but can use the '.
40 'Administrators have greater access to edit these accounts.');
44 $can_create = $this->hasApplicationCapability(
45 PeopleCreateUsersCapability
::CAPABILITY
);
49 'name' => pht('Create Standard User'),
50 'help' => pht('Create a standard user account.'),
56 'name' => pht('Create Bot User'),
57 'help' => pht('Create a new user for use with automated scripts.'),
62 'name' => pht('Create Mailing List User'),
64 'Create a mailing list user to represent an existing, external '.
65 'mailing list like a Google Group or a Mailman list.'),
68 $buttons = id(new AphrontFormRadioButtonControl())
69 ->setLabel(pht('Account Type'))
73 foreach ($types as $type) {
74 $buttons->addButton($type['type'], $type['name'], $type['help']);
77 $form = id(new AphrontFormView())
79 ->appendRemarkupInstructions(
81 'Choose the type of user account to create. For a detailed '.
82 'explanation of user account types, see [[ %s | User Guide: '.
84 PhabricatorEnv
::getDoclink('User Guide: Account Roles')))
85 ->appendChild($buttons)
87 id(new AphrontFormSubmitControl())
88 ->addCancelButton($this->getApplicationURI())
89 ->setValue(pht('Continue')));
91 $crumbs = $this->buildApplicationCrumbs();
92 $crumbs->addTextCrumb($title);
93 $crumbs->setBorder(true);
95 $box = id(new PHUIObjectBoxView())
96 ->setHeaderText($title)
97 ->setBackground(PHUIObjectBoxView
::WHITE_CONFIG
)
100 $guidance_context = new PhabricatorPeopleCreateGuidanceContext();
102 $guidance = id(new PhabricatorGuidanceEngine())
104 ->setGuidanceContext($guidance_context)
107 $view = id(new PHUITwoColumnView())
114 return $this->newPage()
117 ->appendChild($view);