Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / settings / panel / PhabricatorSSHKeysSettingsPanel.php
blob131f6029747cc76897e21014a5b51c44cd0cc5b0
1 <?php
3 final class PhabricatorSSHKeysSettingsPanel extends PhabricatorSettingsPanel {
5 public function isManagementPanel() {
6 if ($this->getUser()->getIsMailingList()) {
7 return false;
10 return true;
13 public function getPanelKey() {
14 return 'ssh';
17 public function getPanelName() {
18 return pht('SSH Public Keys');
21 public function getPanelMenuIcon() {
22 return 'fa-file-text-o';
25 public function getPanelGroupKey() {
26 return PhabricatorSettingsAuthenticationPanelGroup::PANELGROUPKEY;
29 public function processRequest(AphrontRequest $request) {
30 $user = $this->getUser();
31 $viewer = $request->getUser();
33 $keys = id(new PhabricatorAuthSSHKeyQuery())
34 ->setViewer($viewer)
35 ->withObjectPHIDs(array($user->getPHID()))
36 ->withIsActive(true)
37 ->execute();
39 $table = id(new PhabricatorAuthSSHKeyTableView())
40 ->setUser($viewer)
41 ->setKeys($keys)
42 ->setCanEdit(true)
43 ->setNoDataString(pht("You haven't added any SSH Public Keys."));
45 $panel = new PHUIObjectBoxView();
46 $header = new PHUIHeaderView();
48 $ssh_actions = PhabricatorAuthSSHKeyTableView::newKeyActionsMenu(
49 $viewer,
50 $user);
52 return $this->newBox(pht('SSH Public Keys'), $table, array($ssh_actions));