diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index 66346c82b2..f10756f972 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -56,7 +56,7 @@ public function createAuthenticationTabs() $tabs = $this->getTabs(); $tabs->add('userbackend', array( 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'), - 'label' => $this->translate('Authentication'), + 'label' => $this->translate('Users'), 'url' => 'config/userbackend', 'baseTarget' => '_main' )); @@ -96,7 +96,6 @@ public function generalAction() $this->view->form = $form; $this->createApplicationTabs()->activate('general'); - $this->createAuthenticationTabs(); } /** @@ -201,7 +200,6 @@ public function userbackendAction() $form->handleRequest(); $this->view->form = $form; - $this->createApplicationTabs(); $this->createAuthenticationTabs()->activate('userbackend'); $this->render('userbackend/reorder'); } @@ -335,7 +333,6 @@ public function resourceAction() $this->assertPermission('config/application/resources'); $this->view->resources = Config::app('resources', true); $this->createApplicationTabs()->activate('resource'); - $this->createAuthenticationTabs(); } /** diff --git a/application/controllers/GroupController.php b/application/controllers/GroupController.php index bc0211fa32..05dc95fcb7 100644 --- a/application/controllers/GroupController.php +++ b/application/controllers/GroupController.php @@ -342,16 +342,36 @@ protected function createShowTabs($backendName, $groupName) protected function createListTabs() { $tabs = $this->getTabs(); + $tabs->add( + 'role/list', + array( + 'baseTarget' => '_main', + 'label' => $this->translate('Roles'), + 'title' => $this->translate( + 'Configure roles to permit or restrict users and groups accessing Icinga Web 2' + ), + 'url' => 'role/list' + + ) + ); + $tabs->add( + 'user/list', + array( + 'title' => $this->translate('List users of authentication backends'), + 'label' => $this->translate('Users'), + 'icon' => 'user', + 'url' => 'user/list' + ) + ); $tabs->add( 'group/list', array( 'title' => $this->translate('List groups of user group backends'), - 'label' => $this->translate('Usergroups'), + 'label' => $this->translate('User Groups'), 'icon' => 'users', 'url' => 'group/list' ) ); - return $tabs; } } diff --git a/application/controllers/NavigationController.php b/application/controllers/NavigationController.php index c251f61eb4..c079e9fe9a 100644 --- a/application/controllers/NavigationController.php +++ b/application/controllers/NavigationController.php @@ -125,14 +125,24 @@ public function indexAction() $this->view->types = $this->listItemTypes(); $this->view->items = $query; - $this->getTabs()->add( + $this->getTabs() + ->add( + 'preferences', + array( + 'title' => $this->translate('Adjust the preferences of Icinga Web 2 according to your needs'), + 'label' => $this->translate('Preferences'), + 'url' => 'preference' + ) + ) + ->add( 'navigation', array( + 'active' => true, 'title' => $this->translate('List and configure your own navigation items'), 'label' => $this->translate('Navigation'), 'url' => 'navigation' ) - )->activate('navigation'); + ); $this->setupSortControl( array( 'type' => $this->translate('Type'), diff --git a/application/controllers/PreferenceController.php b/application/controllers/PreferenceController.php index 6bf407843b..c5bd59f952 100644 --- a/application/controllers/PreferenceController.php +++ b/application/controllers/PreferenceController.php @@ -28,13 +28,16 @@ class PreferenceController extends BasePreferenceController public static function createProvidedTabs() { return array( - 'preferences' => new Tab( - array( - 'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'), - 'label' => t('Preferences'), - 'url' => Url::fromPath('preference') - ) - ) + 'preferences' => new Tab(array( + 'title' => t('Adjust the preferences of Icinga Web 2 according to your needs'), + 'label' => t('Preferences'), + 'url' => 'preference' + )), + 'navigation' => new Tab(array( + 'title' => t('List and configure your own navigation items'), + 'label' => t('Navigation'), + 'url' => 'navigation' + )) ); } diff --git a/application/controllers/RoleController.php b/application/controllers/RoleController.php index 68fbadf3f0..4e865aadbb 100644 --- a/application/controllers/RoleController.php +++ b/application/controllers/RoleController.php @@ -158,6 +158,24 @@ protected function createListTabs() ) ); + $tabs->add( + 'user/list', + array( + 'title' => $this->translate('List users of authentication backends'), + 'label' => $this->translate('Users'), + 'icon' => 'user', + 'url' => 'user/list' + ) + ); + $tabs->add( + 'group/list', + array( + 'title' => $this->translate('List groups of user group backends'), + 'label' => $this->translate('User Groups'), + 'icon' => 'users', + 'url' => 'group/list' + ) + ); return $tabs; } } diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index 40192b42ff..6160c40ae8 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -305,6 +305,18 @@ protected function createShowTabs($backendName, $userName) protected function createListTabs() { $tabs = $this->getTabs(); + $tabs->add( + 'role/list', + array( + 'baseTarget' => '_main', + 'label' => $this->translate('Roles'), + 'title' => $this->translate( + 'Configure roles to permit or restrict users and groups accessing Icinga Web 2' + ), + 'url' => 'role/list' + + ) + ); $tabs->add( 'user/list', array( @@ -314,7 +326,15 @@ protected function createListTabs() 'url' => 'user/list' ) ); - + $tabs->add( + 'group/list', + array( + 'title' => $this->translate('List groups of user group backends'), + 'label' => $this->translate('User Groups'), + 'icon' => 'users', + 'url' => 'group/list' + ) + ); return $tabs; } } diff --git a/application/controllers/UsergroupbackendController.php b/application/controllers/UsergroupbackendController.php index 7c40dbefb2..19471ea091 100644 --- a/application/controllers/UsergroupbackendController.php +++ b/application/controllers/UsergroupbackendController.php @@ -148,18 +148,6 @@ public function removeAction() protected function createListTabs() { $tabs = $this->getTabs(); - $tabs->add('general', array( - 'title' => $this->translate('Adjust the general configuration of Icinga Web 2'), - 'label' => $this->translate('General'), - 'url' => 'config/general', - 'baseTarget' => '_main' - )); - $tabs->add('resource', array( - 'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'), - 'label' => $this->translate('Resources'), - 'url' => 'config/resource', - 'baseTarget' => '_main' - )); $tabs->add('userbackend', array( 'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'), 'label' => $this->translate('Authentication'), diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index bb316a5371..742407a451 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -251,43 +251,31 @@ public function getMenu() 'permission' => 'config/*', 'priority' => 800, 'children' => array( - 'application' => array( + 'application' => array( 'label' => t('Application'), 'url' => 'config/general', 'permission' => 'config/application/*', 'priority' => 810 ), - 'navigation' => array( - 'label' => t('Shared Navigation'), - 'url' => 'navigation/shared', - 'permission' => 'config/application/navigation', - 'priority' => 820, + 'authentication' => array( + 'label' => t('Authentication'), + 'url' => 'config/userbackend', + 'permission' => 'config/application/*', + 'priority' => 820 ), - 'authentication' => array( - 'label' => t('Authentication'), - 'url' => 'config/userbackend', + 'authorization' => array( + 'label' => t('Authorization'), 'permission' => 'config/authentication/*', - 'priority' => 830 + 'priority' => 830, + 'url' => 'role/list' ), - 'roles' => array( - 'label' => t('Roles'), - 'url' => 'role/list', - 'permission' => 'config/authentication/roles/show', - 'priority' => 840 - ), - 'users' => array( - 'label' => t('Users'), - 'url' => 'user/list', - 'permission' => 'config/authentication/users/show', - 'priority' => 850 - ), - 'groups' => array( - 'label' => t('Usergroups'), - 'url' => 'group/list', - 'permission' => 'config/authentication/groups/show', - 'priority' => 860 + 'navigation' => array( + 'label' => t('Shared Navigation'), + 'url' => 'navigation/shared', + 'permission' => 'config/application/navigation', + 'priority' => 840, ), - 'modules' => array( + 'modules' => array( 'label' => t('Modules'), 'url' => 'config/modules', 'permission' => 'config/modules', @@ -296,22 +284,10 @@ public function getMenu() ) ), 'user' => array( - 'children' => array( - 'preferences' => array( - 'label' => t('Preferences'), - 'url' => 'preference', - 'priority' => 910 - ), - 'navigation' => array( - 'label' => t('Navigation'), - 'url' => 'navigation', - 'priority' => 920 - ) - ), 'cssClass' => 'user-nav-item', 'label' => $this->user->getUsername(), - 'icon' => 'user', - 'url' => 'account', + 'icon' => 'user', + 'url' => 'preference', 'priority' => 900, 'renderer' => array( 'UserNavigationItemRenderer'