Differential D10990 Diff 26398 src/applications/conduit/controller/PhabricatorConduitTokenEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitTokenEditController.php
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| if ($is_new) { | if ($is_new) { | ||||
| $dialog | $dialog | ||||
| ->appendParagraph(pht('Generate a new API token?')) | ->appendParagraph(pht('Generate a new API token?')) | ||||
| ->addSubmitButton($submit_button) | ->addSubmitButton($submit_button) | ||||
| ->addCancelButton($panel_uri); | ->addCancelButton($panel_uri); | ||||
| } else { | } else { | ||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setUser($viewer) | ->setUser($viewer); | ||||
| ->appendChild( | |||||
| if ($token->getTokenType() === PhabricatorConduitToken::TYPE_CLUSTER) { | |||||
| $dialog->appendChild( | |||||
| pht( | |||||
| 'This token is automatically generated by Phabricator, and used '. | |||||
| 'to make requests between nodes in a Phabricator cluster. You '. | |||||
| 'can not use this token in external applications.')); | |||||
| } else { | |||||
| $form->appendChild( | |||||
| id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
| ->setLabel(pht('Token')) | ->setLabel(pht('Token')) | ||||
| ->setValue($token->getToken())); | ->setValue($token->getToken())); | ||||
| } | |||||
| $dialog | $dialog | ||||
| ->appendForm($form) | ->appendForm($form) | ||||
| ->addCancelButton($panel_uri, pht('Done')); | ->addCancelButton($panel_uri, pht('Done')); | ||||
| } | } | ||||
| return $dialog; | return $dialog; | ||||
| } | } | ||||
| } | } | ||||