mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
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
This commit is contained in:
parent
a88dc2afc2
commit
a7dcbe5980
3 changed files with 12 additions and 32 deletions
|
@ -3,20 +3,12 @@
|
|||
final class PhabricatorPeopleApproveController
|
||||
extends PhabricatorPeopleController {
|
||||
|
||||
private $id;
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->id = idx($data, 'id');
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$admin = $request->getUser();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$user = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($admin)
|
||||
->withIDs(array($this->id))
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($request->getURIData('id')))
|
||||
->executeOne();
|
||||
if (!$user) {
|
||||
return new Aphront404Response();
|
||||
|
@ -26,7 +18,7 @@ final class PhabricatorPeopleApproveController
|
|||
|
||||
if ($request->isFormPost()) {
|
||||
id(new PhabricatorUserEditor())
|
||||
->setActor($admin)
|
||||
->setActor($viewer)
|
||||
->approveUser($user, true);
|
||||
|
||||
$title = pht(
|
||||
|
@ -39,12 +31,12 @@ final class PhabricatorPeopleApproveController
|
|||
'Your Phabricator account (%s) has been approved by %s. You can '.
|
||||
'login here:',
|
||||
$user->getUsername(),
|
||||
$admin->getUsername()),
|
||||
$viewer->getUsername()),
|
||||
PhabricatorEnv::getProductionURI('/'));
|
||||
|
||||
$mail = id(new PhabricatorMetaMTAMail())
|
||||
->addTos(array($user->getPHID()))
|
||||
->addCCs(array($admin->getPHID()))
|
||||
->addCCs(array($viewer->getPHID()))
|
||||
->setSubject('[Phabricator] '.$title)
|
||||
->setForceDelivery(true)
|
||||
->setBody($body)
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
final class PhabricatorPeopleListController
|
||||
extends PhabricatorPeopleController {
|
||||
|
||||
private $key;
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
@ -13,16 +11,12 @@ final class PhabricatorPeopleListController
|
|||
return false;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->key = idx($data, 'key');
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$this->requireApplicationCapability(
|
||||
PeopleBrowseUserDirectoryCapability::CAPABILITY);
|
||||
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($this->key)
|
||||
->setQueryKey($request->getURIData('key'))
|
||||
->setSearchEngine(new PhabricatorPeopleSearchEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
|
|
|
@ -3,15 +3,9 @@
|
|||
final class PhabricatorPeopleLogsController
|
||||
extends PhabricatorPeopleController {
|
||||
|
||||
private $queryKey;
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->queryKey = idx($data, 'queryKey');
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($this->queryKey)
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($request->getURIData('queryKey'))
|
||||
->setSearchEngine(new PhabricatorPeopleLogSearchEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
|
|
Loading…
Reference in a new issue