3 final class PhabricatorPeopleApproveController
4 extends PhabricatorPeopleController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $viewer = $request->getViewer();
9 $user = id(new PhabricatorPeopleQuery())
11 ->withIDs(array($request->getURIData('id')))
14 return new Aphront404Response();
17 $via = $request->getURIData('via');
20 $done_uri = urisprintf('/people/manage/%d/', $user->getID());
23 $done_uri = $this->getApplicationURI('query/approval/');
27 if ($user->getIsApproved()) {
28 return $this->newDialog()
29 ->setTitle(pht('Already Approved'))
30 ->appendChild(pht('This user has already been approved.'))
31 ->addCancelButton($done_uri);
34 if ($request->isFormPost()) {
37 $xactions[] = id(new PhabricatorUserTransaction())
38 ->setTransactionType(PhabricatorUserApproveTransaction
::TRANSACTIONTYPE
)
41 id(new PhabricatorUserTransactionEditor())
43 ->setContentSourceFromRequest($request)
44 ->setContinueOnMissingFields(true)
45 ->setContinueOnNoEffect(true)
46 ->applyTransactions($user, $xactions);
48 return id(new AphrontRedirectResponse())->setURI($done_uri);
51 return $this->newDialog()
52 ->setTitle(pht('Confirm Approval'))
55 'Allow %s to access this Phabricator install?',
56 phutil_tag('strong', array(), $user->getUsername())))
57 ->addCancelButton($done_uri)
58 ->addSubmitButton(pht('Approve Account'));