Page MenuHomePhabricator

D16185.diff
No OneTemporary

D16185.diff

diff --git a/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php b/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php
--- a/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php
+++ b/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php
@@ -24,7 +24,10 @@
}
}
- $panel_uri = '/settings/panel/tokens/';
+ $panel_uri = id(new PhabricatorTokensSettingsPanel())
+ ->setViewer($viewer)
+ ->setUser($viewer)
+ ->getPanelURI();
if (!$tokens) {
return $this->newDialog()
diff --git a/src/applications/conduit/controller/PhabricatorConduitController.php b/src/applications/conduit/controller/PhabricatorConduitController.php
--- a/src/applications/conduit/controller/PhabricatorConduitController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitController.php
@@ -25,6 +25,8 @@
}
protected function renderExampleBox(ConduitAPIMethod $method, $params) {
+ $viewer = $this->getViewer();
+
$arc_example = id(new PHUIPropertyListView())
->addRawContent($this->renderExample($method, 'arc', $params));
@@ -34,10 +36,15 @@
$php_example = id(new PHUIPropertyListView())
->addRawContent($this->renderExample($method, 'php', $params));
+ $panel_uri = id(new PhabricatorConduitTokensSettingsPanel())
+ ->setViewer($viewer)
+ ->setUser($viewer)
+ ->getPanelURI();
+
$panel_link = phutil_tag(
'a',
array(
- 'href' => '/settings/panel/apitokens/',
+ 'href' => $panel_uri,
),
pht('Conduit API Tokens'));
diff --git a/src/applications/conduit/controller/PhabricatorConduitTokenEditController.php b/src/applications/conduit/controller/PhabricatorConduitTokenEditController.php
--- a/src/applications/conduit/controller/PhabricatorConduitTokenEditController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitTokenEditController.php
@@ -49,11 +49,10 @@
$submit_button = pht('Generate Token');
}
- if ($viewer->getPHID() == $object->getPHID()) {
- $panel_uri = '/settings/panel/apitokens/';
- } else {
- $panel_uri = '/settings/'.$object->getID().'/panel/apitokens/';
- }
+ $panel_uri = id(new PhabricatorConduitTokensSettingsPanel())
+ ->setViewer($viewer)
+ ->setUser($object)
+ ->getPanelURI();
id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession(
$viewer,
diff --git a/src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php b/src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php
--- a/src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php
@@ -31,7 +31,6 @@
'Really terminate this token? Any system using this token '.
'will no longer be able to make API requests.');
$submit_button = pht('Terminate Token');
- $panel_uri = '/settings/panel/apitokens/';
} else {
$tokens = id(new PhabricatorConduitTokenQuery())
->setViewer($viewer)
@@ -51,7 +50,6 @@
$submit_button = pht('Terminate Tokens');
}
- $panel_uri = '/settings/panel/apitokens/';
if ($object_phid != $viewer->getPHID()) {
$object = id(new PhabricatorObjectQuery())
->setViewer($viewer)
@@ -60,9 +58,15 @@
if (!$object) {
return new Aphront404Response();
}
- $panel_uri = '/settings/'.$object->getID().'/panel/apitokens/';
+ } else {
+ $object = $viewer;
}
+ $panel_uri = id(new PhabricatorConduitTokensSettingsPanel())
+ ->setViewer($viewer)
+ ->setUser($object)
+ ->getPanelURI();
+
id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession(
$viewer,
$request,

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 24, 7:38 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6746090
Default Alt Text
D16185.diff (3 KB)

Event Timeline