Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14021736
D13757.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13757.diff
View Options
diff --git a/src/applications/flag/controller/PhabricatorFlagDeleteController.php b/src/applications/flag/controller/PhabricatorFlagDeleteController.php
--- a/src/applications/flag/controller/PhabricatorFlagDeleteController.php
+++ b/src/applications/flag/controller/PhabricatorFlagDeleteController.php
@@ -2,22 +2,17 @@
final class PhabricatorFlagDeleteController extends PhabricatorFlagController {
- private $id;
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- $flag = id(new PhabricatorFlag())->load($this->id);
+ $flag = id(new PhabricatorFlag())->load($id);
if (!$flag) {
return new Aphront404Response();
}
- if ($flag->getOwnerPHID() != $user->getPHID()) {
+ if ($flag->getOwnerPHID() != $viewer->getPHID()) {
return new Aphront400Response();
}
diff --git a/src/applications/flag/controller/PhabricatorFlagEditController.php b/src/applications/flag/controller/PhabricatorFlagEditController.php
--- a/src/applications/flag/controller/PhabricatorFlagEditController.php
+++ b/src/applications/flag/controller/PhabricatorFlagEditController.php
@@ -2,19 +2,12 @@
final class PhabricatorFlagEditController extends PhabricatorFlagController {
- private $phid;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $phid = $request->getURIData('phid');
- public function willProcessRequest(array $data) {
- $this->phid = $data['phid'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $phid = $this->phid;
$handle = id(new PhabricatorHandleQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withPHIDs(array($phid))
->executeOne();
@@ -22,14 +15,14 @@
return new Aphront404Response();
}
- $flag = PhabricatorFlagQuery::loadUserFlag($user, $phid);
+ $flag = PhabricatorFlagQuery::loadUserFlag($viewer, $phid);
if (!$flag) {
$flag = new PhabricatorFlag();
- $flag->setOwnerPHID($user->getPHID());
+ $flag->setOwnerPHID($viewer->getPHID());
$flag->setType($handle->getType());
$flag->setObjectPHID($handle->getPHID());
- $flag->setReasonPHID($user->getPHID());
+ $flag->setReasonPHID($viewer->getPHID());
}
if ($request->isDialogFormPost()) {
@@ -43,7 +36,7 @@
$type_name = $handle->getTypeName();
$dialog = new AphrontDialogView();
- $dialog->setUser($user);
+ $dialog->setUser($viewer);
$dialog->setTitle(pht('Flag %s', $type_name));
diff --git a/src/applications/flag/controller/PhabricatorFlagListController.php b/src/applications/flag/controller/PhabricatorFlagListController.php
--- a/src/applications/flag/controller/PhabricatorFlagListController.php
+++ b/src/applications/flag/controller/PhabricatorFlagListController.php
@@ -2,19 +2,16 @@
final class PhabricatorFlagListController extends PhabricatorFlagController {
- private $queryKey;
-
public function shouldAllowPublic() {
return true;
}
- public function willProcessRequest(array $data) {
- $this->queryKey = idx($data, 'queryKey');
- }
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $querykey = $request->getURIData('queryKey');
- public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($querykey)
->setSearchEngine(new PhabricatorFlagSearchEngine())
->setNavigation($this->buildSideNavView());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 11:52 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6724303
Default Alt Text
D13757.diff (3 KB)
Attached To
Mode
D13757: Update Flag for handleRequest
Attached
Detach File
Event Timeline
Log In to Comment