Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/people/application/PhabricatorPeopleApplication.php
12256 views
1
<?php
2
3
final 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
'tasks/(?P<id>[1-9]\d*)/' =>
72
'PhabricatorPeopleProfileTasksController',
73
'commits/(?P<id>[1-9]\d*)/' =>
74
'PhabricatorPeopleProfileCommitsController',
75
'revisions/(?P<id>[1-9]\d*)/' =>
76
'PhabricatorPeopleProfileRevisionsController',
77
'picture/(?P<id>[1-9]\d*)/' =>
78
'PhabricatorPeopleProfilePictureController',
79
'manage/(?P<id>[1-9]\d*)/' =>
80
'PhabricatorPeopleProfileManageController',
81
),
82
'/p/(?P<username>[\w._-]+)/' => array(
83
'' => 'PhabricatorPeopleProfileViewController',
84
),
85
);
86
}
87
88
public function getRemarkupRules() {
89
return array(
90
new PhabricatorMentionRemarkupRule(),
91
);
92
}
93
94
protected function getCustomCapabilities() {
95
return array(
96
PeopleCreateUsersCapability::CAPABILITY => array(
97
'default' => PhabricatorPolicies::POLICY_ADMIN,
98
),
99
PeopleDisableUsersCapability::CAPABILITY => array(
100
'default' => PhabricatorPolicies::POLICY_ADMIN,
101
),
102
PeopleBrowseUserDirectoryCapability::CAPABILITY => array(),
103
);
104
}
105
106
public function getApplicationSearchDocumentTypes() {
107
return array(
108
PhabricatorPeopleUserPHIDType::TYPECONST,
109
);
110
}
111
112
}
113
114