3 final class PhabricatorAuthSSHKeyRevokeController
4 extends PhabricatorAuthSSHKeyController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $viewer = $this->getViewer();
9 $key = id(new PhabricatorAuthSSHKeyQuery())
11 ->withIDs(array($request->getURIData('id')))
12 ->requireCapabilities(
14 PhabricatorPolicyCapability
::CAN_VIEW
,
15 PhabricatorPolicyCapability
::CAN_EDIT
,
19 return new Aphront404Response();
22 $cancel_uri = $key->getURI();
24 $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession(
29 if ($request->isFormPost()) {
32 $xactions[] = id(new PhabricatorAuthSSHKeyTransaction())
33 ->setTransactionType(PhabricatorAuthSSHKeyTransaction
::TYPE_DEACTIVATE
)
36 id(new PhabricatorAuthSSHKeyEditor())
38 ->setContentSourceFromRequest($request)
39 ->setContinueOnNoEffect(true)
40 ->setContinueOnMissingFields(true)
41 ->applyTransactions($key, $xactions);
43 return id(new AphrontRedirectResponse())->setURI($cancel_uri);
46 $name = phutil_tag('strong', array(), $key->getName());
48 return $this->newDialog()
49 ->setTitle(pht('Revoke SSH Public Key'))
52 'The key "%s" will be permanently revoked, and you will no '.
53 'longer be able to use the corresponding private key to '.
56 ->addSubmitButton(pht('Revoke Public Key'))
57 ->addCancelButton($cancel_uri);