Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/conduit/controller/PhabricatorConduitTokenController.php b/src/applications/conduit/controller/PhabricatorConduitTokenController.php
index 694671a0dc..b750d60d4c 100644
--- a/src/applications/conduit/controller/PhabricatorConduitTokenController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitTokenController.php
@@ -1,66 +1,70 @@
<?php
/**
* @group conduit
*/
final class PhabricatorConduitTokenController
extends PhabricatorConduitController {
public function processRequest() {
$user = $this->getRequest()->getUser();
// Ideally we'd like to verify this, but it's fine to leave it unguarded
// for now and verifying it would need some Ajax junk or for the user to
// click a button or similar.
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
$old_token = id(new PhabricatorConduitCertificateToken())
->loadOneWhere(
'userPHID = %s',
$user->getPHID());
if ($old_token) {
$old_token->delete();
}
$token = id(new PhabricatorConduitCertificateToken())
->setUserPHID($user->getPHID())
->setToken(Filesystem::readRandomCharacters(40))
->save();
unset($unguarded);
$pre_instructions = pht(
'Copy and paste this token into the prompt given to you by '.
'`arc install-certificate`');
$post_instructions = pht(
'After you copy and paste this token, `arc` will complete '.
'the certificate install process for you.');
$form = id(new AphrontFormView())
->setUser($user)
->appendRemarkupInstructions($pre_instructions)
->appendChild(
id(new AphrontFormTextAreaControl())
->setLabel(pht('Token'))
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT)
->setValue($token->getToken()))
->appendRemarkupInstructions($post_instructions);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName(pht('Install Certificate')));
+ $object_box = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Certificate Token'))
+ ->setForm($form);
+
return $this->buildApplicationPage(
array(
$crumbs,
- $form,
+ $object_box,
),
array(
'title' => pht('Certificate Install Token'),
'device' => true,
));
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Jul 28, 2:56 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
187011
Default Alt Text
(2 KB)

Event Timeline