mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-19 20:04:24 +02:00
Add user account menu and move logout and preferences inside it
This commit is contained in:
parent
2bae33d6ad
commit
993390941a
@ -4,6 +4,7 @@
|
||||
|
||||
namespace Icinga\Web;
|
||||
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Web\Menu\MenuItemRenderer;
|
||||
use RecursiveIterator;
|
||||
use Zend_Config;
|
||||
@ -201,6 +202,10 @@ class Menu implements RecursiveIterator
|
||||
*/
|
||||
protected function addMainMenuItems()
|
||||
{
|
||||
$auth = Manager::getInstance();
|
||||
|
||||
if ($auth->isAuthenticated()) {
|
||||
|
||||
$this->add(t('Dashboard'), array(
|
||||
'url' => 'dashboard',
|
||||
'icon' => 'img/icons/dashboard.png',
|
||||
@ -211,10 +216,6 @@ class Menu implements RecursiveIterator
|
||||
'icon' => 'img/icons/configuration.png',
|
||||
'priority' => 200
|
||||
));
|
||||
$section->add(t('Preferences'), array(
|
||||
'url' => 'preference',
|
||||
'priority' => 200
|
||||
));
|
||||
$section->add(t('Configuration'), array(
|
||||
'url' => 'config',
|
||||
'priority' => 300
|
||||
@ -231,11 +232,20 @@ class Menu implements RecursiveIterator
|
||||
));
|
||||
}
|
||||
|
||||
$this->add(t('Logout'), array(
|
||||
'url' => 'authentication/logout',
|
||||
'icon' => 'img/icons/logout.png',
|
||||
'priority' => 300
|
||||
$section = $this->add($auth->getUser()->getUsername(), array(
|
||||
'icon' => 'img/icons/user.png',
|
||||
'priority' => 600
|
||||
));
|
||||
$section->add(t('Preferences'), array(
|
||||
'url' => 'preference',
|
||||
'priority' => 601
|
||||
));
|
||||
|
||||
$section->add(t('Logout'), array(
|
||||
'url' => 'authentication/logout',
|
||||
'priority' => 700
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user