@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<?php
2
3abstract class PhabricatorOAuthClientController
4 extends PhabricatorOAuthServerController {
5
6 private $clientPHID;
7
8 protected function getClientPHID() {
9 return $this->clientPHID;
10 }
11
12 private function setClientPHID($phid) {
13 $this->clientPHID = $phid;
14 return $this;
15 }
16
17 public function shouldRequireLogin() {
18 return true;
19 }
20
21 public function willProcessRequest(array $data) {
22 $this->setClientPHID(idx($data, 'phid'));
23 }
24
25 public function buildSideNavView($for_app = false) {
26 $user = $this->getRequest()->getUser();
27
28 $nav = new AphrontSideNavFilterView();
29 $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
30
31 id(new PhabricatorOAuthServerClientSearchEngine())
32 ->setViewer($user)
33 ->addNavigationItems($nav->getMenu());
34
35 $nav->selectFilter(null);
36
37 return $nav;
38 }
39
40}