From 51755209b649aafd1bb993e7f8b58fba9bf50a43 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 12 Jul 2013 15:37:36 +0200 Subject: [PATCH] Adapt usage of config class refs #4354 --- Vagrantfile | 4 +- application/controllers/ModulesController.php | 15 ++-- .../layouts/scripts/parts/navigation.phtml | 2 +- config/{icinga.ini => config.ini} | 0 .../modules/monitoring}/backends.ini | 4 +- .../modules/monitoring}/instances.ini | 0 .../modules/monitoring}/menu.ini | 0 .../Application/ApplicationBootstrap.php | 26 +++---- library/Icinga/Application/Config.php | 39 ++++++----- library/Icinga/Application/Modules/Module.php | 4 +- library/Icinga/Application/Web.php | 2 +- .../Backend/LdapUserBackend.php | 26 +++---- library/Icinga/Authentication/Manager.php | 68 +++++++++---------- library/Icinga/Backend.php | 10 +-- library/Icinga/Web/ActionController.php | 23 ++++++- library/Icinga/Web/ModuleActionController.php | 4 +- .../monitoring/library/Monitoring/Backend.php | 5 +- public/css.php | 2 +- public/index.php | 2 +- 19 files changed, 129 insertions(+), 107 deletions(-) rename config/{icinga.ini => config.ini} (100%) rename {modules/monitoring/config => config/modules/monitoring}/backends.ini (59%) rename {modules/monitoring/config => config/modules/monitoring}/instances.ini (100%) rename {modules/monitoring/config => config/modules/monitoring}/menu.ini (100%) diff --git a/Vagrantfile b/Vagrantfile index 5a6eaf508..79419bad3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -48,6 +48,8 @@ Vagrant::Config.run do |config| # an identifier, the second is the path on the guest to mount the # folder, and the third is the path on the host to the actual folder. # # config.vm.share_folder "v-icinga2-web-pub", "/var/www/html/icinga2-web", "./pub" + config.vm.share_folder "v-test", "/vagrant/config", "./config", :owner => 'vagrant', :group => 'apache', :extra => 'dmode=775,fmode=775' + config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-test", "1"] # Enable provisioning with Puppet stand alone. Puppet manifests # are contained in a directory path relative to this Vagrantfile. @@ -56,7 +58,7 @@ Vagrant::Config.run do |config| config.vm.provision :puppet do |puppet| puppet.module_path = ".vagrant-puppet/modules" puppet.manifests_path = ".vagrant-puppet/manifests" - #puppet.options = "-v -d" + # # puppet.options = "-v -d" end # The npm module jquery won't install via puppet because of an mysterious error diff --git a/application/controllers/ModulesController.php b/application/controllers/ModulesController.php index 8e28308ea..1a5dec426 100755 --- a/application/controllers/ModulesController.php +++ b/application/controllers/ModulesController.php @@ -4,21 +4,21 @@ /** * Icinga 2 Web - Head for multiple monitoring frontends * Copyright (C) 2013 Icinga Development Team - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * + * * @copyright 2013 Icinga Development Team * @author Icinga Development Team */ @@ -58,16 +58,15 @@ class ModulesController extends ActionController public function overviewAction() { $this->indexAction(); - + } public function enableAction() { $this->manager->enableModule($this->_getParam('name')); $this->manager->loadModule($this->_getParam('name')); - $this->getResponse()->setHeader('X-Icinga-Enable-Module', $this->_getParam('name')); - $this->replaceLayout = true; - $this->indexAction(); + $this->getResponse()->setHeader('X-Icinga-Enable-Module', $this->_getParam('name')); + $this->redirectNow('index?_render=body'); } diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml index bb166d86c..04dbf801e 100755 --- a/application/layouts/scripts/parts/navigation.phtml +++ b/application/layouts/scripts/parts/navigation.phtml @@ -3,7 +3,7 @@ $url = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); $currentKey = isset($this->navkey) ? $this->navkey : $url; - $item = $this->navigation->listAll("menu"); + $item = $this->navigation->keys("menu"); ?> auth()->isAuthenticated()): ?>