@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove Certificate page

Summary: Closes T9703. This page has become redundant 10 months ago, at D10988.

Test Plan: Look at /settings page, don't see word "Certificate".

Reviewers: epriestley, #blessed_reviewers, chad

Reviewed By: #blessed_reviewers, chad

Subscribers: Korvin

Maniphest Tasks: T9703

Differential Revision: https://secure.phabricator.com/D14400

authored by

Aviv Eyal and committed by
avivey
18f0371b 2b05f7cc

-140
-2
src/__phutil_library_map__.php
··· 1846 1846 'PhabricatorCommonPasswords' => 'applications/auth/constants/PhabricatorCommonPasswords.php', 1847 1847 'PhabricatorConduitAPIController' => 'applications/conduit/controller/PhabricatorConduitAPIController.php', 1848 1848 'PhabricatorConduitApplication' => 'applications/conduit/application/PhabricatorConduitApplication.php', 1849 - 'PhabricatorConduitCertificateSettingsPanel' => 'applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php', 1850 1849 'PhabricatorConduitCertificateToken' => 'applications/conduit/storage/PhabricatorConduitCertificateToken.php', 1851 1850 'PhabricatorConduitConnectionLog' => 'applications/conduit/storage/PhabricatorConduitConnectionLog.php', 1852 1851 'PhabricatorConduitConsoleController' => 'applications/conduit/controller/PhabricatorConduitConsoleController.php', ··· 5837 5836 'PhabricatorCommonPasswords' => 'Phobject', 5838 5837 'PhabricatorConduitAPIController' => 'PhabricatorConduitController', 5839 5838 'PhabricatorConduitApplication' => 'PhabricatorApplication', 5840 - 'PhabricatorConduitCertificateSettingsPanel' => 'PhabricatorSettingsPanel', 5841 5839 'PhabricatorConduitCertificateToken' => 'PhabricatorConduitDAO', 5842 5840 'PhabricatorConduitConnectionLog' => 'PhabricatorConduitDAO', 5843 5841 'PhabricatorConduitConsoleController' => 'PhabricatorConduitController',
-138
src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php
··· 1 - <?php 2 - 3 - final class PhabricatorConduitCertificateSettingsPanel 4 - extends PhabricatorSettingsPanel { 5 - 6 - public function isEditableByAdministrators() { 7 - return true; 8 - } 9 - 10 - public function getPanelKey() { 11 - return 'conduit'; 12 - } 13 - 14 - public function getPanelName() { 15 - return pht('Conduit Certificate'); 16 - } 17 - 18 - public function getPanelGroup() { 19 - return pht('Authentication'); 20 - } 21 - 22 - public function isEnabled() { 23 - if ($this->getUser()->getIsMailingList()) { 24 - return false; 25 - } 26 - 27 - return true; 28 - } 29 - 30 - public function processRequest(AphrontRequest $request) { 31 - $user = $this->getUser(); 32 - $viewer = $request->getUser(); 33 - 34 - id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( 35 - $viewer, 36 - $request, 37 - '/settings/'); 38 - 39 - if ($request->isFormPost()) { 40 - if (!$request->isDialogFormPost()) { 41 - $dialog = new AphrontDialogView(); 42 - $dialog->setUser($viewer); 43 - $dialog->setTitle(pht('Really regenerate session?')); 44 - $dialog->setSubmitURI($this->getPanelURI()); 45 - $dialog->addSubmitButton(pht('Regenerate')); 46 - $dialog->addCancelbutton($this->getPanelURI()); 47 - $dialog->appendChild(phutil_tag('p', array(), pht( 48 - 'Really destroy the old certificate? Any established '. 49 - 'sessions will be terminated.'))); 50 - 51 - return id(new AphrontDialogResponse()) 52 - ->setDialog($dialog); 53 - } 54 - 55 - $sessions = id(new PhabricatorAuthSessionQuery()) 56 - ->setViewer($user) 57 - ->withIdentityPHIDs(array($user->getPHID())) 58 - ->withSessionTypes(array(PhabricatorAuthSession::TYPE_CONDUIT)) 59 - ->execute(); 60 - foreach ($sessions as $session) { 61 - $session->delete(); 62 - } 63 - 64 - // This implicitly regenerates the certificate. 65 - $user->setConduitCertificate(null); 66 - $user->save(); 67 - return id(new AphrontRedirectResponse()) 68 - ->setURI($this->getPanelURI('?regenerated=true')); 69 - } 70 - 71 - if ($request->getStr('regenerated')) { 72 - $notice = new PHUIInfoView(); 73 - $notice->setSeverity(PHUIInfoView::SEVERITY_NOTICE); 74 - $notice->setTitle(pht('Certificate Regenerated')); 75 - $notice->appendChild(phutil_tag( 76 - 'p', 77 - array(), 78 - pht( 79 - 'Your old certificate has been destroyed and you have been issued '. 80 - 'a new certificate. Sessions established under the old certificate '. 81 - 'are no longer valid.'))); 82 - $notice = $notice->render(); 83 - } else { 84 - $notice = null; 85 - } 86 - 87 - Javelin::initBehavior('select-on-click'); 88 - 89 - $cert_form = new AphrontFormView(); 90 - $cert_form 91 - ->setUser($viewer) 92 - ->appendChild(phutil_tag( 93 - 'p', 94 - array('class' => 'aphront-form-instructions'), 95 - pht( 96 - 'This certificate allows you to authenticate over Conduit, '. 97 - 'the Phabricator API. Normally, you just run %s to install it.', 98 - phutil_tag('tt', array(), 'arc install-certificate')))) 99 - ->appendChild( 100 - id(new AphrontFormTextAreaControl()) 101 - ->setLabel(pht('Certificate')) 102 - ->setHeight(AphrontFormTextAreaControl::HEIGHT_SHORT) 103 - ->setReadonly(true) 104 - ->setSigil('select-on-click') 105 - ->setValue($user->getConduitCertificate())); 106 - 107 - $cert_form = id(new PHUIObjectBoxView()) 108 - ->setHeaderText(pht('Arcanist Certificate')) 109 - ->setForm($cert_form); 110 - 111 - $regen_instruction = pht( 112 - 'You can regenerate this certificate, which '. 113 - 'will invalidate the old certificate and create a new one.'); 114 - 115 - $regen_form = new AphrontFormView(); 116 - $regen_form 117 - ->setUser($viewer) 118 - ->setAction($this->getPanelURI()) 119 - ->setWorkflow(true) 120 - ->appendChild(phutil_tag( 121 - 'p', 122 - array('class' => 'aphront-form-instructions'), 123 - $regen_instruction)) 124 - ->appendChild( 125 - id(new AphrontFormSubmitControl()) 126 - ->setValue(pht('Regenerate Certificate'))); 127 - 128 - $regen_form = id(new PHUIObjectBoxView()) 129 - ->setHeaderText(pht('Regenerate Certificate')) 130 - ->setForm($regen_form); 131 - 132 - return array( 133 - $notice, 134 - $cert_form, 135 - $regen_form, 136 - ); 137 - } 138 - }