diff --git a/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php b/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php index 6d516916eb..8e063ba565 100644 --- a/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php +++ b/src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php @@ -24,7 +24,10 @@ final class PhabricatorAuthRevokeTokenController } } - $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 index 000d01f888..b29c05f2af 100644 --- a/src/applications/conduit/controller/PhabricatorConduitController.php +++ b/src/applications/conduit/controller/PhabricatorConduitController.php @@ -25,6 +25,8 @@ abstract class PhabricatorConduitController extends PhabricatorController { } protected function renderExampleBox(ConduitAPIMethod $method, $params) { + $viewer = $this->getViewer(); + $arc_example = id(new PHUIPropertyListView()) ->addRawContent($this->renderExample($method, 'arc', $params)); @@ -34,10 +36,15 @@ abstract class PhabricatorConduitController extends PhabricatorController { $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 index 503456d010..7550f92210 100644 --- a/src/applications/conduit/controller/PhabricatorConduitTokenEditController.php +++ b/src/applications/conduit/controller/PhabricatorConduitTokenEditController.php @@ -49,11 +49,10 @@ final class PhabricatorConduitTokenEditController $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 index 466089ebeb..9f1ffd2964 100644 --- a/src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php +++ b/src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php @@ -31,7 +31,6 @@ final class PhabricatorConduitTokenTerminateController '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 @@ final class PhabricatorConduitTokenTerminateController $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 @@ final class PhabricatorConduitTokenTerminateController 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,