@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
3final class PhabricatorPeopleApplication extends PhabricatorApplication {
4
5 public function getName() {
6 return pht('People');
7 }
8
9 public function getShortDescription() {
10 return pht('User Accounts and Profiles');
11 }
12
13 public function getBaseURI() {
14 return '/people/';
15 }
16
17 public function getTitleGlyph() {
18 return "\xE2\x99\x9F";
19 }
20
21 public function getIcon() {
22 return 'fa-users';
23 }
24
25 public function isPinnedByDefault(PhabricatorUser $viewer) {
26 return $viewer->getIsAdmin();
27 }
28
29 public function getFlavorText() {
30 return pht('Sort of a social utility.');
31 }
32
33 public function getApplicationGroup() {
34 return self::GROUP_UTILITIES;
35 }
36
37 public function canUninstall() {
38 return false;
39 }
40
41 public function getRoutes() {
42 return array(
43 '/people/' => array(
44 $this->getQueryRoutePattern() => 'PhabricatorPeopleListController',
45 'logs/' => array(
46 $this->getQueryRoutePattern() => 'PhabricatorPeopleLogsController',
47 '(?P<id>\d+)/' => 'PhabricatorPeopleLogViewController',
48 ),
49 'invite/' => array(
50 '(?:query/(?P<queryKey>[^/]+)/)?'
51 => 'PhabricatorPeopleInviteListController',
52 'send/'
53 => 'PhabricatorPeopleInviteSendController',
54 ),
55 'approve/(?P<id>[1-9]\d*)/(?:via/(?P<via>[^/]+)/)?'
56 => 'PhabricatorPeopleApproveController',
57 '(?P<via>disapprove)/(?P<id>[1-9]\d*)/'
58 => 'PhabricatorPeopleDisableController',
59 '(?P<via>disable)/(?P<id>[1-9]\d*)/'
60 => 'PhabricatorPeopleDisableController',
61 'empower/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleEmpowerController',
62 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleDeleteController',
63 'rename/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleRenameController',
64 'welcome/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleWelcomeController',
65 'create/' => 'PhabricatorPeopleCreateController',
66 'new/(?P<type>[^/]+)/' => 'PhabricatorPeopleNewController',
67 'editprofile/(?P<id>[1-9]\d*)/' =>
68 'PhabricatorPeopleProfileEditController',
69 'badges/(?P<id>[1-9]\d*)/' =>
70 'PhabricatorPeopleProfileBadgesController',
71 // Legacy route only kept for backward compatibility after T15998
72 'tasks/(?P<id>[1-9]\d*)/' =>
73 'PhabricatorPeopleProfileTasksAssignedController',
74 'tasks/assigned/(?P<id>[1-9]\d*)/' =>
75 'PhabricatorPeopleProfileTasksAssignedController',
76 'tasks/authored/(?P<id>[1-9]\d*)/' =>
77 'PhabricatorPeopleProfileTasksAuthoredController',
78 'commits/(?P<id>[1-9]\d*)/' =>
79 'PhabricatorPeopleProfileCommitsController',
80 'revisions/(?P<id>[1-9]\d*)/' =>
81 'PhabricatorPeopleProfileRevisionsController',
82 'picture/(?P<id>[1-9]\d*)/' =>
83 'PhabricatorPeopleProfilePictureController',
84 'manage/(?P<id>[1-9]\d*)/' =>
85 'PhabricatorPeopleProfileManageController',
86 ),
87 '/p/(?P<username>[\w._-]+)/' => array(
88 '' => 'PhabricatorPeopleProfileViewController',
89 ),
90 );
91 }
92
93 public function getRemarkupRules() {
94 return array(
95 new PhabricatorMentionRemarkupRule(),
96 );
97 }
98
99 protected function getCustomCapabilities() {
100 return array(
101 PeopleCreateUsersCapability::CAPABILITY => array(
102 'default' => PhabricatorPolicies::POLICY_ADMIN,
103 ),
104 PeopleDisableUsersCapability::CAPABILITY => array(
105 'default' => PhabricatorPolicies::POLICY_ADMIN,
106 ),
107 PeopleBrowseUserDirectoryCapability::CAPABILITY => array(),
108 );
109 }
110
111 public function getApplicationSearchDocumentTypes() {
112 return array(
113 PhabricatorPeopleUserPHIDType::TYPECONST,
114 );
115 }
116
117}