Differential D20123 Diff 48061 src/applications/people/controller/PhabricatorPeopleApproveController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/controller/PhabricatorPeopleApproveController.php
<?php | <?php | ||||
final class PhabricatorPeopleApproveController | final class PhabricatorPeopleApproveController | ||||
extends PhabricatorPeopleController { | extends PhabricatorPeopleController { | ||||
public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $request->getViewer(); | $viewer = $request->getViewer(); | ||||
$user = id(new PhabricatorPeopleQuery()) | $user = id(new PhabricatorPeopleQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($request->getURIData('id'))) | ->withIDs(array($request->getURIData('id'))) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$user) { | if (!$user) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$via = $request->getURIData('via'); | |||||
switch ($via) { | |||||
case 'profile': | |||||
$done_uri = urisprintf('/people/manage/%d/', $user->getID()); | |||||
break; | |||||
default: | |||||
$done_uri = $this->getApplicationURI('query/approval/'); | $done_uri = $this->getApplicationURI('query/approval/'); | ||||
break; | |||||
} | |||||
if ($user->getIsApproved()) { | if ($user->getIsApproved()) { | ||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle(pht('Already Approved')) | ->setTitle(pht('Already Approved')) | ||||
->appendChild(pht('This user has already been approved.')) | ->appendChild(pht('This user has already been approved.')) | ||||
->addCancelButton($done_uri); | ->addCancelButton($done_uri); | ||||
} | } | ||||
Show All 27 Lines |