Remove product literal strings in "pht()", part 18
[phabricator.git] / src / applications / auth / application / PhabricatorAuthApplication.php
blob3e020a208bfe268fa596ec584074ce92b64accf4
1 <?php
3 final class PhabricatorAuthApplication extends PhabricatorApplication {
5 public function canUninstall() {
6 return false;
9 public function getBaseURI() {
10 return '/auth/';
13 public function getIcon() {
14 return 'fa-key';
17 public function isPinnedByDefault(PhabricatorUser $viewer) {
18 return $viewer->getIsAdmin();
21 public function getName() {
22 return pht('Auth');
25 public function getShortDescription() {
26 return pht('Login/Registration');
29 public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
30 // NOTE: Although reasonable help exists for this in "Configuring Accounts
31 // and Registration", specifying help items here means we get the menu
32 // item in all the login/link interfaces, which is confusing and not
33 // helpful.
35 // TODO: Special case this, or split the auth and auth administration
36 // applications?
38 return array();
41 public function getApplicationGroup() {
42 return self::GROUP_ADMIN;
45 public function getRoutes() {
46 return array(
47 '/auth/' => array(
48 '' => 'PhabricatorAuthListController',
49 'config/' => array(
50 'new/' => 'PhabricatorAuthNewController',
51 'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorAuthEditController',
52 '(?P<action>enable|disable)/(?P<id>\d+)/'
53 => 'PhabricatorAuthDisableController',
54 'view/(?P<id>\d+)/' => 'PhabricatorAuthProviderViewController',
56 'login/(?P<pkey>[^/]+)/(?:(?P<extra>[^/]+)/)?'
57 => 'PhabricatorAuthLoginController',
58 '(?P<loggedout>loggedout)/' => 'PhabricatorAuthStartController',
59 'invite/(?P<code>[^/]+)/' => 'PhabricatorAuthInviteController',
60 'register/(?:(?P<akey>[^/]+)/)?' => 'PhabricatorAuthRegisterController',
61 'start/' => 'PhabricatorAuthStartController',
62 'validate/' => 'PhabricatorAuthValidateController',
63 'finish/' => 'PhabricatorAuthFinishController',
64 'unlink/(?P<id>\d+)/' => 'PhabricatorAuthUnlinkController',
65 '(?P<action>link|refresh)/(?P<id>\d+)/'
66 => 'PhabricatorAuthLinkController',
67 'confirmlink/(?P<akey>[^/]+)/'
68 => 'PhabricatorAuthConfirmLinkController',
69 'session/terminate/(?P<id>[^/]+)/'
70 => 'PhabricatorAuthTerminateSessionController',
71 'token/revoke/(?P<id>[^/]+)/'
72 => 'PhabricatorAuthRevokeTokenController',
73 'session/downgrade/'
74 => 'PhabricatorAuthDowngradeSessionController',
75 'enroll/' => array(
76 '(?:(?P<pageKey>[^/]+)/)?'
77 => 'PhabricatorAuthNeedsMultiFactorController',
79 'sshkey/' => array(
80 $this->getQueryRoutePattern('for/(?P<forPHID>[^/]+)/')
81 => 'PhabricatorAuthSSHKeyListController',
82 'generate/' => 'PhabricatorAuthSSHKeyGenerateController',
83 'upload/' => 'PhabricatorAuthSSHKeyEditController',
84 'edit/(?P<id>\d+)/' => 'PhabricatorAuthSSHKeyEditController',
85 'revoke/(?P<id>\d+)/'
86 => 'PhabricatorAuthSSHKeyRevokeController',
87 'view/(?P<id>\d+)/' => 'PhabricatorAuthSSHKeyViewController',
90 'password/' => 'PhabricatorAuthSetPasswordController',
91 'external/' => 'PhabricatorAuthSetExternalController',
93 'mfa/' => array(
94 $this->getQueryRoutePattern() =>
95 'PhabricatorAuthFactorProviderListController',
96 $this->getEditRoutePattern('edit/') =>
97 'PhabricatorAuthFactorProviderEditController',
98 '(?P<id>[1-9]\d*)/' =>
99 'PhabricatorAuthFactorProviderViewController',
100 'message/(?P<id>[1-9]\d*)/' =>
101 'PhabricatorAuthFactorProviderMessageController',
102 'challenge/status/(?P<id>[1-9]\d*)/' =>
103 'PhabricatorAuthChallengeStatusController',
106 'message/' => array(
107 $this->getQueryRoutePattern() =>
108 'PhabricatorAuthMessageListController',
109 $this->getEditRoutePattern('edit/') =>
110 'PhabricatorAuthMessageEditController',
111 '(?P<id>[^/]+)/' =>
112 'PhabricatorAuthMessageViewController',
115 'contact/' => array(
116 $this->getEditRoutePattern('edit/') =>
117 'PhabricatorAuthContactNumberEditController',
118 '(?P<id>[1-9]\d*)/' =>
119 'PhabricatorAuthContactNumberViewController',
120 '(?P<action>disable|enable)/(?P<id>[1-9]\d*)/' =>
121 'PhabricatorAuthContactNumberDisableController',
122 'primary/(?P<id>[1-9]\d*)/' =>
123 'PhabricatorAuthContactNumberPrimaryController',
124 'test/(?P<id>[1-9]\d*)/' =>
125 'PhabricatorAuthContactNumberTestController',
129 '/oauth/(?P<provider>\w+)/login/'
130 => 'PhabricatorAuthOldOAuthRedirectController',
132 '/login/' => array(
133 '' => 'PhabricatorAuthStartController',
134 'email/' => 'PhabricatorEmailLoginController',
135 'once/'.
136 '(?P<type>[^/]+)/'.
137 '(?P<id>\d+)/'.
138 '(?P<key>[^/]+)/'.
139 '(?:(?P<emailID>\d+)/)?' => 'PhabricatorAuthOneTimeLoginController',
140 'refresh/' => 'PhabricatorRefreshCSRFController',
141 'mustverify/' => 'PhabricatorMustVerifyEmailController',
144 '/emailverify/(?P<code>[^/]+)/'
145 => 'PhabricatorEmailVerificationController',
147 '/logout/' => 'PhabricatorLogoutController',
151 protected function getCustomCapabilities() {
152 return array(
153 AuthManageProvidersCapability::CAPABILITY => array(
154 'default' => PhabricatorPolicies::POLICY_ADMIN,