@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update People for handleRequest

Summary: Ref T8628. Updates people controllers for handleRequest

Test Plan: Viewed the people list, viewed the activity logs, then went through the approval process for a new user account.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D16451

Josh Cox a7dcbe59 a88dc2af

+12 -32
+7 -15
src/applications/people/controller/PhabricatorPeopleApproveController.php
··· 3 3 final class PhabricatorPeopleApproveController 4 4 extends PhabricatorPeopleController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - 14 - $request = $this->getRequest(); 15 - $admin = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 16 8 17 9 $user = id(new PhabricatorPeopleQuery()) 18 - ->setViewer($admin) 19 - ->withIDs(array($this->id)) 10 + ->setViewer($viewer) 11 + ->withIDs(array($request->getURIData('id'))) 20 12 ->executeOne(); 21 13 if (!$user) { 22 14 return new Aphront404Response(); ··· 26 18 27 19 if ($request->isFormPost()) { 28 20 id(new PhabricatorUserEditor()) 29 - ->setActor($admin) 21 + ->setActor($viewer) 30 22 ->approveUser($user, true); 31 23 32 24 $title = pht( ··· 39 31 'Your Phabricator account (%s) has been approved by %s. You can '. 40 32 'login here:', 41 33 $user->getUsername(), 42 - $admin->getUsername()), 34 + $viewer->getUsername()), 43 35 PhabricatorEnv::getProductionURI('/')); 44 36 45 37 $mail = id(new PhabricatorMetaMTAMail()) 46 38 ->addTos(array($user->getPHID())) 47 - ->addCCs(array($admin->getPHID())) 39 + ->addCCs(array($viewer->getPHID())) 48 40 ->setSubject('[Phabricator] '.$title) 49 41 ->setForceDelivery(true) 50 42 ->setBody($body)
+2 -8
src/applications/people/controller/PhabricatorPeopleListController.php
··· 3 3 final class PhabricatorPeopleListController 4 4 extends PhabricatorPeopleController { 5 5 6 - private $key; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } ··· 13 11 return false; 14 12 } 15 13 16 - public function willProcessRequest(array $data) { 17 - $this->key = idx($data, 'key'); 18 - } 19 - 20 - public function processRequest() { 14 + public function handleRequest(AphrontRequest $request) { 21 15 $this->requireApplicationCapability( 22 16 PeopleBrowseUserDirectoryCapability::CAPABILITY); 23 17 24 18 $controller = id(new PhabricatorApplicationSearchController()) 25 - ->setQueryKey($this->key) 19 + ->setQueryKey($request->getURIData('key')) 26 20 ->setSearchEngine(new PhabricatorPeopleSearchEngine()) 27 21 ->setNavigation($this->buildSideNavView()); 28 22
+3 -9
src/applications/people/controller/PhabricatorPeopleLogsController.php
··· 3 3 final class PhabricatorPeopleLogsController 4 4 extends PhabricatorPeopleController { 5 5 6 - private $queryKey; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->queryKey = idx($data, 'queryKey'); 10 - } 11 - 12 - public function processRequest() { 13 - $controller = id(new PhabricatorApplicationSearchController()) 14 - ->setQueryKey($this->queryKey) 6 + public function handleRequest(AphrontRequest $request) { 7 + $controller = id(new PhabricatorApplicationSearchController()) 8 + ->setQueryKey($request->getURIData('queryKey')) 15 9 ->setSearchEngine(new PhabricatorPeopleLogSearchEngine()) 16 10 ->setNavigation($this->buildSideNavView()); 17 11