parent
4befc9be94
commit
15999eb880
|
@ -94,8 +94,8 @@ class AuthenticationController extends ActionController
|
||||||
));
|
));
|
||||||
$this->replaceLayout = true;
|
$this->replaceLayout = true;
|
||||||
$auth->removeAuthorization();
|
$auth->removeAuthorization();
|
||||||
$this->_forward('login');
|
$this->redirect('login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
|
@ -2,25 +2,28 @@
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
/**
|
/**
|
||||||
* Icinga 2 Web - Head for multiple monitoring frontends
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
* Copyright (C) 2013 Icinga Development Team
|
* Copyright (C) 2013 Icinga Development Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation; either version 2
|
* as published by the Free Software Foundation; either version 2
|
||||||
* of the License, or (at your option) any later version.
|
* of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
||||||
* @author Icinga Development Team <info@icinga.org>
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
@ -47,7 +50,7 @@ class IndexController extends ActionController
|
||||||
{
|
{
|
||||||
parent::preDispatch(); // -> auth :(
|
parent::preDispatch(); // -> auth :(
|
||||||
if ($this->action_name !== 'welcome') {
|
if ($this->action_name !== 'welcome') {
|
||||||
$this->_forward('welcome');
|
$this->redirect('index/welcome');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
/**
|
/**
|
||||||
* Icinga 2 Web - Head for multiple monitoring frontends
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
* Copyright (C) 2013 Icinga Development Team
|
* Copyright (C) 2013 Icinga Development Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -20,25 +22,42 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
||||||
* @author Icinga Development Team <info@icinga.org>
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
|
||||||
# namespace Icinga\Application\Controllers;
|
# namespace Icinga\Application\Controllers;
|
||||||
|
|
||||||
use Icinga\Web\ActionController;
|
use Icinga\Web\ActionController;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Web\Hook\Configuration\ConfigurationTabBuilder;
|
use Icinga\Web\Hook\Configuration\ConfigurationTabBuilder;
|
||||||
|
use Icinga\Application\Modules\Manager as ModuleManager;
|
||||||
|
use Zend_Controller_Action as ZfActionController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle module depending frontend actions
|
||||||
|
*/
|
||||||
class ModulesController extends ActionController
|
class ModulesController extends ActionController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var ModuleManager
|
||||||
|
*/
|
||||||
protected $manager;
|
protected $manager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup this controller
|
||||||
|
* @see ZfActionController::init
|
||||||
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->manager = Icinga::app()->getModuleManager();
|
$this->manager = Icinga::app()->getModuleManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a list of all modules
|
||||||
|
*/
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$tabBuilder = new ConfigurationTabBuilder(
|
$tabBuilder = new ConfigurationTabBuilder(
|
||||||
|
@ -55,25 +74,37 @@ class ModulesController extends ActionController
|
||||||
$this->render('overview');
|
$this->render('overview');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias for index
|
||||||
|
*
|
||||||
|
* @see self::indexAction
|
||||||
|
*/
|
||||||
public function overviewAction()
|
public function overviewAction()
|
||||||
{
|
{
|
||||||
$this->indexAction();
|
$this->indexAction();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable a module
|
||||||
|
*/
|
||||||
public function enableAction()
|
public function enableAction()
|
||||||
{
|
{
|
||||||
$this->manager->enableModule($this->_getParam('name'));
|
$this->manager->enableModule($this->_getParam('name'));
|
||||||
$this->manager->loadModule($this->_getParam('name'));
|
$this->manager->loadModule($this->_getParam('name'));
|
||||||
$this->getResponse()->setHeader('X-Icinga-Enable-Module', $this->_getParam('name'));
|
$this->getResponse()->setHeader('X-Icinga-Enable-Module', $this->_getParam('name'));
|
||||||
$this->redirectNow('index?_render=body');
|
$this->redirectNow('modules/overview?_render=body');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable a module
|
||||||
|
*/
|
||||||
public function disableAction()
|
public function disableAction()
|
||||||
{
|
{
|
||||||
$this->manager->disableModule($this->_getParam('name'));
|
$this->manager->disableModule($this->_getParam('name'));
|
||||||
$this->redirectNow('modules/overview?_render=body');
|
$this->redirectNow('modules/overview?_render=body');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @codingStandardsIgnoreEnd
|
|
@ -1,4 +1,31 @@
|
||||||
<?php
|
<?php
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
/**
|
||||||
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
|
* 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 <info@icinga.org>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
|
*/
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
use Icinga\Web\ActionController;
|
use Icinga\Web\ActionController;
|
||||||
use Icinga\Application\Icinga,
|
use Icinga\Application\Icinga,
|
||||||
|
@ -47,7 +74,7 @@ class StaticController extends ActionController
|
||||||
{
|
{
|
||||||
$module = $this->_getParam('moduleName');
|
$module = $this->_getParam('moduleName');
|
||||||
$file = $this->_getParam('file');
|
$file = $this->_getParam('file');
|
||||||
$basedir = Icinga::app()->getModule($module)->getBaseDir();
|
$basedir = Icinga::app()->getModuleManager()->getModule($module)->getBaseDir();
|
||||||
|
|
||||||
$filePath = $basedir . '/public/img/' . $file;
|
$filePath = $basedir . '/public/img/' . $file;
|
||||||
if (! file_exists($filePath)) {
|
if (! file_exists($filePath)) {
|
||||||
|
@ -80,9 +107,10 @@ class StaticController extends ActionController
|
||||||
|
|
||||||
public function javascriptAction()
|
public function javascriptAction()
|
||||||
{
|
{
|
||||||
$module = $this->_getParam('moduleName');
|
$module = $this->_getParam('module_name');
|
||||||
$file = $this->_getParam('file');
|
$file = $this->_getParam('file');
|
||||||
$basedir = Icinga::app()->getModule($module)->getBaseDir();
|
|
||||||
|
$basedir = Icinga::app()->getModuleManager()->getModule($module)->getBaseDir();
|
||||||
|
|
||||||
$filePath = $basedir . '/public/js/' . $file;
|
$filePath = $basedir . '/public/js/' . $file;
|
||||||
if (!file_exists($filePath)) {
|
if (!file_exists($filePath)) {
|
||||||
|
@ -119,3 +147,5 @@ class StaticController extends ActionController
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @codingStandardsIgnoreEnd
|
|
@ -683,42 +683,6 @@ class CommandPipe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start obsessing over provided services/hosts
|
|
||||||
*
|
|
||||||
* @param array $objects An array of hosts and/or services
|
|
||||||
*/
|
|
||||||
public function startObsessing($objects)
|
|
||||||
{
|
|
||||||
foreach ($objects as $object) {
|
|
||||||
$type = $this->getObjectType($object);
|
|
||||||
$msg = "START_OBSESSING_OVER_". (($type == self::TYPE_SERVICE) ? 'SVC' : 'HOST');
|
|
||||||
$msg .= ';'.$object->host_name;
|
|
||||||
if ($type == self::TYPE_SERVICE) {
|
|
||||||
$msg .= ';'.$object->service_description;
|
|
||||||
}
|
|
||||||
$this->send($msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stop obsessing over provided services/hosts
|
|
||||||
*
|
|
||||||
* @param array $objects An array of hosts and/or services
|
|
||||||
*/
|
|
||||||
public function stopObsessing($objects)
|
|
||||||
{
|
|
||||||
foreach ($objects as $object) {
|
|
||||||
$type = $this->getObjectType($object);
|
|
||||||
$msg = "STOP_OBSESSING_OVER_". (($type == self::TYPE_SERVICE) ? 'SVC' : 'HOST');
|
|
||||||
$msg .= ';'.$object->host_name;
|
|
||||||
if ($type == self::TYPE_SERVICE) {
|
|
||||||
$msg .= ';'.$object->service_description;
|
|
||||||
}
|
|
||||||
$this->send($msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a custom host or service notification
|
* Send a custom host or service notification
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,30 @@
|
||||||
<?php
|
<?php
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
/**
|
||||||
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
|
* 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 <info@icinga.org>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
use Monitoring\Backend;
|
use Monitoring\Backend;
|
||||||
|
@ -342,7 +367,7 @@ class Monitoring_ShowController extends ModuleActionController
|
||||||
$id = $this->_getParam('ticket');
|
$id = $this->_getParam('ticket');
|
||||||
$ticketModule = 'rt';
|
$ticketModule = 'rt';
|
||||||
$this->render();
|
$this->render();
|
||||||
$this->_forward(
|
$this->redirect(
|
||||||
'ticket',
|
'ticket',
|
||||||
'show',
|
'show',
|
||||||
$ticketModule,
|
$ticketModule,
|
||||||
|
@ -483,3 +508,5 @@ class Monitoring_ShowController extends ModuleActionController
|
||||||
return $tabs;
|
return $tabs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @codingStandardsIgnoreEnd
|
Loading…
Reference in New Issue