Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
| <?php | <?php | ||||
| final class PhabricatorSSHKeysSettingsPanel extends PhabricatorSettingsPanel { | final class PhabricatorSSHKeysSettingsPanel extends PhabricatorSettingsPanel { | ||||
| public function isEditableByAdministrators() { | public function isManagementPanel() { | ||||
| if ($this->getUser()->getIsMailingList()) { | |||||
| return false; | |||||
| } | |||||
| return true; | return true; | ||||
| } | } | ||||
| public function getPanelKey() { | public function getPanelKey() { | ||||
| return 'ssh'; | return 'ssh'; | ||||
| } | } | ||||
| public function getPanelName() { | public function getPanelName() { | ||||
| return pht('SSH Public Keys'); | return pht('SSH Public Keys'); | ||||
| } | } | ||||
| public function getPanelGroupKey() { | public function getPanelGroupKey() { | ||||
| return PhabricatorSettingsAuthenticationPanelGroup::PANELGROUPKEY; | return PhabricatorSettingsAuthenticationPanelGroup::PANELGROUPKEY; | ||||
| } | } | ||||
| public function isEnabled() { | |||||
| if ($this->getUser()->getIsMailingList()) { | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| public function processRequest(AphrontRequest $request) { | public function processRequest(AphrontRequest $request) { | ||||
| $user = $this->getUser(); | $user = $this->getUser(); | ||||
| $viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
| $keys = id(new PhabricatorAuthSSHKeyQuery()) | $keys = id(new PhabricatorAuthSSHKeyQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withObjectPHIDs(array($user->getPHID())) | ->withObjectPHIDs(array($user->getPHID())) | ||||
| ->withIsActive(true) | ->withIsActive(true) | ||||
| Show All 25 Lines | |||||