mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-23 03:59:25 +01:00
Summary: Ref T1536. - Move all the provider-specific help into contextual help in Auth. - This provides help much more contextually, and we can just tell the user the right values to use to configure things. - Rewrite account/registration help to reflect the newer state of the word. - Also clean up a few other loose ends. Test Plan: {F46937} Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T1536 Differential Revision: https://secure.phabricator.com/D6247
88 lines
2.6 KiB
PHP
88 lines
2.6 KiB
PHP
<?php
|
|
|
|
final class PhabricatorApplicationAuth extends PhabricatorApplication {
|
|
|
|
public function canUninstall() {
|
|
return false;
|
|
}
|
|
|
|
public function getBaseURI() {
|
|
return '/auth/';
|
|
}
|
|
|
|
public function getIconName() {
|
|
return 'authentication';
|
|
}
|
|
|
|
public function getHelpURI() {
|
|
// NOTE: Although reasonable help exists for this in "Configuring Accounts
|
|
// and Registration", specifying a help URI here means we get the menu
|
|
// item in all the login/link interfaces, which is confusing and not
|
|
// helpful.
|
|
|
|
// TODO: Special case this, or split the auth and auth administration
|
|
// applications?
|
|
|
|
return null;
|
|
}
|
|
|
|
public function buildMainMenuItems(
|
|
PhabricatorUser $user,
|
|
PhabricatorController $controller = null) {
|
|
|
|
$items = array();
|
|
|
|
if ($user->isLoggedIn()) {
|
|
$item = id(new PHUIListItemView())
|
|
->addClass('core-menu-item')
|
|
->setName(pht('Log Out'))
|
|
->setIcon('power')
|
|
->setWorkflow(true)
|
|
->setHref('/logout/')
|
|
->setSelected(($controller instanceof PhabricatorLogoutController));
|
|
$items[] = $item;
|
|
}
|
|
|
|
return $items;
|
|
}
|
|
|
|
public function getApplicationGroup() {
|
|
return self::GROUP_ADMIN;
|
|
}
|
|
|
|
public function getRoutes() {
|
|
return array(
|
|
'/auth/' => array(
|
|
'' => 'PhabricatorAuthListController',
|
|
'config/' => array(
|
|
'new/' => 'PhabricatorAuthNewController',
|
|
'new/(?P<className>[^/]+)/' => 'PhabricatorAuthEditController',
|
|
'edit/(?P<id>\d+)/' => 'PhabricatorAuthEditController',
|
|
'(?P<action>enable|disable)/(?P<id>\d+)/' =>
|
|
'PhabricatorAuthDisableController',
|
|
),
|
|
'login/(?P<pkey>[^/]+)/' => 'PhabricatorAuthLoginController',
|
|
'register/(?:(?P<akey>[^/]+)/)?' => 'PhabricatorAuthRegisterController',
|
|
'start/' => 'PhabricatorAuthStartController',
|
|
'validate/' => 'PhabricatorAuthValidateController',
|
|
'unlink/(?P<pkey>[^/]+)/' => 'PhabricatorAuthUnlinkController',
|
|
'link/(?P<pkey>[^/]+)/' => 'PhabricatorAuthLinkController',
|
|
'confirmlink/(?P<akey>[^/]+)/'
|
|
=> 'PhabricatorAuthConfirmLinkController',
|
|
),
|
|
|
|
'/oauth/google/login/' => 'PhabricatorAuthOldOAuthRedirectController',
|
|
|
|
'/login/' => array(
|
|
'' => 'PhabricatorAuthStartController',
|
|
'email/' => 'PhabricatorEmailLoginController',
|
|
'etoken/(?P<token>\w+)/' => 'PhabricatorEmailTokenController',
|
|
'refresh/' => 'PhabricatorRefreshCSRFController',
|
|
'mustverify/' => 'PhabricatorMustVerifyEmailController',
|
|
),
|
|
|
|
'/logout/' => 'PhabricatorLogoutController',
|
|
);
|
|
}
|
|
|
|
}
|