Differential D9431 Diff 22523 src/applications/conduit/controller/PhabricatorConduitAPIController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitAPIController.php
| Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | final class PhabricatorConduitAPIController | ||||
| * @param ConduitAPIRequest Request being executed. | * @param ConduitAPIRequest Request being executed. | ||||
| * @param string The username of the user we want to act as | * @param string The username of the user we want to act as | ||||
| */ | */ | ||||
| private function actAsUser( | private function actAsUser( | ||||
| ConduitAPIRequest $api_request, | ConduitAPIRequest $api_request, | ||||
| $user_name) { | $user_name) { | ||||
| if (!$api_request->getUser()->getIsAdmin()) { | if (!$api_request->getUser()->getIsAdmin()) { | ||||
| throw new Exception("Only administrators can use actAsUser"); | throw new Exception('Only administrators can use actAsUser'); | ||||
| } | } | ||||
| $user = id(new PhabricatorUser())->loadOneWhere( | $user = id(new PhabricatorUser())->loadOneWhere( | ||||
| 'userName = %s', | 'userName = %s', | ||||
| $user_name); | $user_name); | ||||
| if (!$user) { | if (!$user) { | ||||
| throw new Exception( | throw new Exception( | ||||
| ▲ Show 20 Lines • Show All 292 Lines • Show Last 20 Lines | |||||