From bfdf34b6bf88ffd12956eddfd12abf7a4af90067 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 19 Nov 2014 15:32:25 +0100 Subject: [PATCH] Security: Add permissions as tab to config refs #5647 --- application/controllers/ConfigController.php | 9 ++++++--- .../controllers/PermissionsController.php | 19 +++++++++++++++++++ .../views/scripts/permissions/index.phtml | 3 +++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index 8f5f9eb42..73d40261c 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -24,14 +24,17 @@ class ConfigController extends ActionController public function init() { $this->view->tabs = Widget::create('tabs')->add('index', array( - 'title' => 'Application', + 'title' => $this->translate('Application'), 'url' => 'config' ))->add('authentication', array( - 'title' => 'Authentication', + 'title' => $this->translate('Authentication'), 'url' => 'config/authentication' ))->add('resources', array( - 'title' => 'Resources', + 'title' => $this->translate('Resources'), 'url' => 'config/resource' + ))->add('permissions', array( + 'title' => $this->translate('Permissions'), + 'url' => 'permissions' )); } diff --git a/application/controllers/PermissionsController.php b/application/controllers/PermissionsController.php index effd80852..8709a28ad 100644 --- a/application/controllers/PermissionsController.php +++ b/application/controllers/PermissionsController.php @@ -7,11 +7,30 @@ use Icinga\Forms\ConfirmRemovalForm; use Icinga\Forms\Security\RoleForm; use Icinga\Web\Controller\ActionController; use Icinga\Web\Notification; +use Icinga\Web\Widget; class PermissionsController extends ActionController { + public function init() + { + $this->view->tabs = Widget::create('tabs')->add('index', array( + 'title' => $this->translate('Application'), + 'url' => 'config' + ))->add('authentication', array( + 'title' => $this->translate('Authentication'), + 'url' => 'config/authentication' + ))->add('resources', array( + 'title' => $this->translate('Resources'), + 'url' => 'config/resource' + ))->add('permissions', array( + 'title' => $this->translate('Permissions'), + 'url' => 'permissions' + )); + } + public function indexAction() { + $this->view->tabs->activate('permissions'); $this->view->roles = Config::app('roles', true); } diff --git a/application/views/scripts/permissions/index.phtml b/application/views/scripts/permissions/index.phtml index 8918cdd46..285d2f894 100644 --- a/application/views/scripts/permissions/index.phtml +++ b/application/views/scripts/permissions/index.phtml @@ -1,3 +1,6 @@ +
+ +

translate('Permissions') ?>