mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-06 04:41:01 +01:00
0fa411083f
Summary: - If you're an administrator and there are users waiting for approval, show a count on the home page. - Sort out the `isUserActivated()` access check. - Hide all the menu widgets except "Logout" for disabled and unapproved users. - Add a "Log In" item. - Add a bunch of unit tests. Test Plan: Ran unit tests, clicked around as unapproved/approved/logged-in/logged-out users. Reviewers: btrahan Reviewed By: btrahan CC: aran, chad Differential Revision: https://secure.phabricator.com/D7574
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
|
|
final class PhabricatorApplicationSettings extends PhabricatorApplication {
|
|
|
|
public function getBaseURI() {
|
|
return '/settings/';
|
|
}
|
|
|
|
public function getShortDescription() {
|
|
return 'User Preferences';
|
|
}
|
|
|
|
public function getIconName() {
|
|
return 'settings';
|
|
}
|
|
|
|
public function canUninstall() {
|
|
return false;
|
|
}
|
|
|
|
public function getRoutes() {
|
|
return array(
|
|
'/settings/' => array(
|
|
'(?:panel/(?P<key>[^/]+)/)?' => 'PhabricatorSettingsMainController',
|
|
'adjust/' => 'PhabricatorSettingsAdjustController',
|
|
),
|
|
);
|
|
}
|
|
|
|
public function getApplicationGroup() {
|
|
return self::GROUP_UTILITIES;
|
|
}
|
|
|
|
public function buildMainMenuItems(
|
|
PhabricatorUser $user,
|
|
PhabricatorController $controller = null) {
|
|
|
|
$items = array();
|
|
|
|
if ($user->isLoggedIn() && $user->isUserActivated()) {
|
|
$selected = ($controller instanceof PhabricatorSettingsMainController);
|
|
$item = new PHUIListItemView();
|
|
$item->setName(pht('Settings'));
|
|
$item->setIcon('settings');
|
|
$item->addClass('core-menu-item');
|
|
$item->setSelected($selected);
|
|
$item->setHref('/settings/');
|
|
$items[] = $item;
|
|
}
|
|
|
|
return $items;
|
|
}
|
|
|
|
}
|