Merge remote-tracking branch 'origin/master' into feature/add-to-dashboard-4537
Conflicts: application/controllers/DashboardController.php library/Icinga/Web/Form.php library/Icinga/Web/Widget/Dashboard.php
|
@ -10,3 +10,5 @@ var/log/*
|
|||
|
||||
# Exclude symlink you need for packaging
|
||||
/debian
|
||||
|
||||
build/*
|
||||
|
|
|
@ -602,14 +602,14 @@ exec { 'create-pgsql-icingaweb-db':
|
|||
}
|
||||
|
||||
exec { 'populate-icingaweb-mysql-db-tables':
|
||||
unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM account;" &> /dev/null',
|
||||
command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/mysql.sql',
|
||||
unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_group;" &> /dev/null',
|
||||
command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/mysql.schema.sql',
|
||||
require => [ Exec['create-mysql-icingaweb-db'] ]
|
||||
}
|
||||
|
||||
exec { 'populate-icingweba-pgsql-db-tables':
|
||||
unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM account;" &> /dev/null',
|
||||
command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/pgsql.sql',
|
||||
unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM icingaweb_group;" &> /dev/null',
|
||||
command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/pgsql.schema.sql',
|
||||
require => [ Exec['create-pgsql-icingaweb-db'] ]
|
||||
}
|
||||
|
||||
|
|
|
@ -33,15 +33,8 @@ class AuthenticationController extends ActionController
|
|||
*/
|
||||
public function loginAction()
|
||||
{
|
||||
if (@file_exists(Config::$configDir . '/setup.token')) {
|
||||
try {
|
||||
$config = Config::app()->toArray();
|
||||
if (empty($config)) {
|
||||
$this->redirectNow(Url::fromPath('setup'));
|
||||
}
|
||||
} catch (NotReadableError $e) {
|
||||
// Gets thrown in case of insufficient permission only
|
||||
}
|
||||
if (@file_exists(Config::resolvePath('setup.token')) && !@file_exists(Config::resolvePath('config.ini'))) {
|
||||
$this->redirectNow(Url::fromPath('setup'));
|
||||
}
|
||||
|
||||
$auth = $this->Auth();
|
||||
|
|
|
@ -177,10 +177,10 @@ class ConfigController extends ActionController
|
|||
public function removeauthenticationbackendAction()
|
||||
{
|
||||
$form = new ConfirmRemovalForm(array(
|
||||
'onSuccess' => function ($request) {
|
||||
'onSuccess' => function ($form) {
|
||||
$configForm = new AuthenticationBackendConfigForm();
|
||||
$configForm->setIniConfig(Config::app('authentication'));
|
||||
$authBackend = $request->getQuery('auth_backend');
|
||||
$authBackend = $form->getRequest()->getQuery('auth_backend');
|
||||
|
||||
try {
|
||||
$configForm->remove($authBackend);
|
||||
|
@ -212,7 +212,7 @@ class ConfigController extends ActionController
|
|||
*/
|
||||
public function resourceAction()
|
||||
{
|
||||
$this->view->resources = Config::app('resources', true)->toArray();
|
||||
$this->view->resources = Config::app('resources', true)->keys();
|
||||
$this->view->tabs->activate('resources');
|
||||
}
|
||||
|
||||
|
@ -250,10 +250,10 @@ class ConfigController extends ActionController
|
|||
public function removeresourceAction()
|
||||
{
|
||||
$form = new ConfirmRemovalForm(array(
|
||||
'onSuccess' => function ($request) {
|
||||
'onSuccess' => function ($form) {
|
||||
$configForm = new ResourceConfigForm();
|
||||
$configForm->setIniConfig(Config::app('resources'));
|
||||
$resource = $request->getQuery('resource');
|
||||
$resource = $form->getRequest()->getQuery('resource');
|
||||
|
||||
try {
|
||||
$configForm->remove($resource);
|
||||
|
@ -274,9 +274,9 @@ class ConfigController extends ActionController
|
|||
|
||||
// Check if selected resource is currently used for authentication
|
||||
$resource = $this->getRequest()->getQuery('resource');
|
||||
$authConfig = Config::app('authentication')->toArray();
|
||||
$authConfig = Config::app('authentication');
|
||||
foreach ($authConfig as $backendName => $config) {
|
||||
if (array_key_exists('resource', $config) && $config['resource'] === $resource) {
|
||||
if ($config->get('resource') === $resource) {
|
||||
$form->addError(sprintf(
|
||||
$this->translate(
|
||||
'The resource "%s" is currently in use by the authentication backend "%s". ' .
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use Icinga\Module\Monitoring\Controller;
|
||||
use Icinga\Web\Url;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Protocol\File\FileReader;
|
||||
use \Zend_Controller_Action_Exception as ActionError;
|
||||
|
||||
|
@ -48,7 +48,7 @@ class ListController extends Controller
|
|||
. ' - (?<message>.*)$/'; // message
|
||||
|
||||
$loggerWriter = Logger::getInstance()->getWriter();
|
||||
$resource = new FileReader(new Config(array(
|
||||
$resource = new FileReader(new ConfigObject(array(
|
||||
'filename' => $loggerWriter->getPath(),
|
||||
'fields' => $pattern
|
||||
)));
|
||||
|
|
|
@ -39,8 +39,8 @@ class PreferenceController extends BasePreferenceController
|
|||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$storeConfig = Config::app()->preferences;
|
||||
if ($storeConfig === null) {
|
||||
$storeConfig = Config::app()->getSection('preferences');
|
||||
if ($storeConfig->isEmpty()) {
|
||||
throw new ConfigurationError(t('You need to configure how to store preferences first.'));
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class AutologinBackendForm extends Form
|
|||
'hidden',
|
||||
'backend',
|
||||
array(
|
||||
'required' => true,
|
||||
'disabled' => true,
|
||||
'value' => 'autologin'
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
namespace Icinga\Forms\Config\Authentication;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Authentication\Backend\DbUserBackend;
|
||||
|
||||
|
@ -75,7 +75,7 @@ class DbBackendForm extends Form
|
|||
'hidden',
|
||||
'backend',
|
||||
array(
|
||||
'required' => true,
|
||||
'disabled' => true,
|
||||
'value' => 'db'
|
||||
)
|
||||
);
|
||||
|
@ -121,7 +121,7 @@ class DbBackendForm extends Form
|
|||
/**
|
||||
* Return the configuration for the chosen resource
|
||||
*
|
||||
* @return Config
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function getResourceConfig()
|
||||
{
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
namespace Icinga\Forms\Config\Authentication;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Exception\AuthenticationException;
|
||||
use Icinga\Authentication\Backend\LdapUserBackend;
|
||||
|
@ -96,7 +96,7 @@ class LdapBackendForm extends Form
|
|||
'hidden',
|
||||
'backend',
|
||||
array(
|
||||
'required' => true,
|
||||
'disabled' => true,
|
||||
'value' => 'ldap'
|
||||
)
|
||||
);
|
||||
|
@ -156,7 +156,7 @@ class LdapBackendForm extends Form
|
|||
/**
|
||||
* Return the configuration for the chosen resource
|
||||
*
|
||||
* @return Config
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function getResourceConfig()
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ use Icinga\Forms\ConfigForm;
|
|||
use Icinga\Web\Notification;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Platform;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Forms\Config\Authentication\DbBackendForm;
|
||||
|
@ -91,12 +92,12 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
$name = isset($values['name']) ? $values['name'] : '';
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(t('Authentication backend name missing'));
|
||||
} elseif ($this->config->get($name) !== null) {
|
||||
} elseif ($this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Authentication backend already exists'));
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
$this->config->{$name} = $values;
|
||||
$this->config->setSection($name, $values);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -116,18 +117,19 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
throw new InvalidArgumentException(t('Old authentication backend name missing'));
|
||||
} elseif (! ($newName = isset($values['name']) ? $values['name'] : '')) {
|
||||
throw new InvalidArgumentException(t('New authentication backend name missing'));
|
||||
} elseif (($backendConfig = $this->config->get($name)) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Unknown authentication backend provided'));
|
||||
}
|
||||
|
||||
$backendConfig = $this->config->getSection($name);
|
||||
if ($newName !== $name) {
|
||||
// Only remove the old entry if it has changed as the order gets screwed when editing backend names
|
||||
unset($this->config->{$name});
|
||||
$this->config->removeSection($name);
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
$this->config->{$newName} = array_merge($backendConfig->toArray(), $values);
|
||||
return $this->config->{$newName};
|
||||
$this->config->setSection($newName, $backendConfig->merge($values));
|
||||
return $backendConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,11 +145,12 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
{
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(t('Authentication backend name missing'));
|
||||
} elseif (($backendConfig = $this->config->get($name)) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Unknown authentication backend provided'));
|
||||
}
|
||||
|
||||
unset($this->config->{$name});
|
||||
$backendConfig = $this->config->getSection($name);
|
||||
$this->config->removeSection($name);
|
||||
return $backendConfig;
|
||||
}
|
||||
|
||||
|
@ -165,7 +168,7 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
{
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(t('Authentication backend name missing'));
|
||||
} elseif ($this->config->get($name) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Unknown authentication backend provided'));
|
||||
}
|
||||
|
||||
|
@ -175,10 +178,10 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
|
||||
$newConfig = array();
|
||||
foreach ($backendOrder as $backendName) {
|
||||
$newConfig[$backendName] = $this->config->get($backendName);
|
||||
$newConfig[$backendName] = $this->config->getSection($backendName);
|
||||
}
|
||||
|
||||
$config = new Config($newConfig);
|
||||
$config = Config::fromArray($newConfig);
|
||||
$this->config = $config->setConfigFile($this->config->getConfigFile());
|
||||
return $this;
|
||||
}
|
||||
|
@ -235,13 +238,13 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
if ($authBackend !== null) {
|
||||
if ($authBackend === '') {
|
||||
throw new ConfigurationError(t('Authentication backend name missing'));
|
||||
} elseif (false === isset($this->config->{$authBackend})) {
|
||||
} elseif (! $this->config->hasSection($authBackend)) {
|
||||
throw new ConfigurationError(t('Unknown authentication backend provided'));
|
||||
} elseif (false === isset($this->config->{$authBackend}->backend)) {
|
||||
} elseif ($this->config->getSection($authBackend)->backend === null) {
|
||||
throw new ConfigurationError(sprintf(t('Backend "%s" has no `backend\' setting'), $authBackend));
|
||||
}
|
||||
|
||||
$configValues = $this->config->{$authBackend}->toArray();
|
||||
$configValues = $this->config->getSection($authBackend)->toArray();
|
||||
$configValues['type'] = $configValues['backend'];
|
||||
$configValues['name'] = $authBackend;
|
||||
$this->populate($configValues);
|
||||
|
@ -332,7 +335,7 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||
/**
|
||||
* Return the configuration for the chosen resource
|
||||
*
|
||||
* @return Config
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function getResourceConfig()
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ class GeneralConfigForm extends ConfigForm
|
|||
$sections[$section][$property] = $value;
|
||||
}
|
||||
foreach ($sections as $section => $config) {
|
||||
$this->config->{$section} = $config;
|
||||
$this->config->setSection($section, $config);
|
||||
}
|
||||
|
||||
if ($this->save()) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
namespace Icinga\Forms\Config\Resource;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Application\Platform;
|
||||
|
||||
|
@ -129,7 +129,7 @@ class DbResourceForm extends Form
|
|||
public static function isValidResource(Form $form)
|
||||
{
|
||||
try {
|
||||
$resource = ResourceFactory::createResource(new Config($form->getValues()));
|
||||
$resource = ResourceFactory::createResource(new ConfigObject($form->getValues()));
|
||||
$resource->getConnection()->getConnection();
|
||||
} catch (Exception $e) {
|
||||
$form->addError(t('Connectivity validation failed, connection to the given resource not possible.'));
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
namespace Icinga\Forms\Config\Resource;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
|
||||
/**
|
||||
|
@ -110,7 +110,7 @@ class LdapResourceForm extends Form
|
|||
public static function isValidResource(Form $form)
|
||||
{
|
||||
try {
|
||||
$resource = ResourceFactory::createResource(new Config($form->getValues()));
|
||||
$resource = ResourceFactory::createResource(new ConfigObject($form->getValues()));
|
||||
if (false === $resource->testCredentials(
|
||||
$form->getElement('bind_dn')->getValue(),
|
||||
$form->getElement('bind_pw')->getValue()
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
namespace Icinga\Forms\Config\Resource;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ class LivestatusResourceForm extends Form
|
|||
public static function isValidResource(Form $form)
|
||||
{
|
||||
try {
|
||||
$resource = ResourceFactory::createResource(new Config($form->getValues()));
|
||||
$resource = ResourceFactory::createResource(new ConfigObject($form->getValues()));
|
||||
$resource->connect()->disconnect();
|
||||
} catch (Exception $e) {
|
||||
$form->addError(t('Connectivity validation failed, connection to the given resource not possible.'));
|
||||
|
|
|
@ -63,12 +63,12 @@ class ResourceConfigForm extends ConfigForm
|
|||
$name = isset($values['name']) ? $values['name'] : '';
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(t('Resource name missing'));
|
||||
} elseif ($this->config->{$name} !== null) {
|
||||
} elseif ($this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Resource already exists'));
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
$this->config->{$name} = $values;
|
||||
$this->config->setSection($name, $values);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -88,14 +88,15 @@ class ResourceConfigForm extends ConfigForm
|
|||
throw new InvalidArgumentException(t('Old resource name missing'));
|
||||
} elseif (! ($newName = isset($values['name']) ? $values['name'] : '')) {
|
||||
throw new InvalidArgumentException(t('New resource name missing'));
|
||||
} elseif (($resourceConfig = $this->config->get($name)) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Unknown resource provided'));
|
||||
}
|
||||
|
||||
$resourceConfig = $this->config->getSection($name);
|
||||
$this->config->removeSection($name);
|
||||
unset($values['name']);
|
||||
unset($this->config->{$name});
|
||||
$this->config->{$newName} = array_merge($resourceConfig->toArray(), $values);
|
||||
return $this->config->{$newName};
|
||||
$this->config->setSection($newName, $resourceConfig->merge($values));
|
||||
return $resourceConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,11 +112,12 @@ class ResourceConfigForm extends ConfigForm
|
|||
{
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(t('Resource name missing'));
|
||||
} elseif (($resourceConfig = $this->config->get($name)) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(t('Unknown resource provided'));
|
||||
}
|
||||
|
||||
unset($this->config->{$name});
|
||||
$resourceConfig = $this->config->getSection($name);
|
||||
$this->config->removeSection($name);
|
||||
return $resourceConfig;
|
||||
}
|
||||
|
||||
|
@ -171,11 +173,11 @@ class ResourceConfigForm extends ConfigForm
|
|||
if ($resource !== null) {
|
||||
if ($resource === '') {
|
||||
throw new ConfigurationError(t('Resource name missing'));
|
||||
} elseif (false === isset($this->config->{$resource})) {
|
||||
} elseif (! $this->config->hasSection($resource)) {
|
||||
throw new ConfigurationError(t('Unknown resource provided'));
|
||||
}
|
||||
|
||||
$configValues = $this->config->{$resource}->toArray();
|
||||
$configValues = $this->config->getSection($resource)->toArray();
|
||||
$configValues['name'] = $resource;
|
||||
$this->populate($configValues);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,6 @@
|
|||
|
||||
namespace Icinga\Forms;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Protocol\Ldap\Exception as LdapException;
|
||||
use Icinga\Protocol\Ldap\Connection;
|
||||
use Icinga\Protocol\Dns;
|
||||
use Icinga\Web\Form;
|
||||
|
||||
class LdapDiscoveryForm extends Form
|
||||
|
@ -77,4 +72,4 @@ class LdapDiscoveryForm extends Form
|
|||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->resources as $name => $resource): ?>
|
||||
<?php foreach ($this->resources as $name): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?= $this->href('config/editresource', array('resource' => $name)); ?>">
|
||||
|
|
|
@ -1,125 +0,0 @@
|
|||
/* ==========================================================================
|
||||
Styles ONLY used for documentation
|
||||
========================================================================== */
|
||||
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/* Projektname - color customer CI */
|
||||
|
||||
.docu-project-name {
|
||||
font-size: 2em;
|
||||
color: #049BAF;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-main {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
margin-top: 50px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.docu-main-headline {
|
||||
font-size: 2em;
|
||||
color: #333;
|
||||
/* customer CI */
|
||||
padding-bottom: 10px;
|
||||
padding-top: 40px;
|
||||
}
|
||||
|
||||
|
||||
.docu-sub-headline {
|
||||
font-size: 1.5em;
|
||||
color: #333;
|
||||
padding-bottom: 3px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-section {
|
||||
border: 1px solid #dddddd;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.docu-description {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-example {
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-example:before {
|
||||
color: #BBBBBB;
|
||||
content: "Example";
|
||||
font-weight: bold;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-module {
|
||||
/* width: 320px; */
|
||||
/* show your modules in device width */
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-codeblock {
|
||||
background-color: #F7F7F9;
|
||||
border-top: 1px solid #e1e1e8;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.docu-codeblock:before {
|
||||
color: #BBBBBB;
|
||||
content: "Code";
|
||||
font-weight: bold;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.docu-code {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: bold;
|
||||
color: #777;
|
||||
padding-top: 10px;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
|
||||
.docu-footer {
|
||||
margin-top: 40px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #dddddd;
|
||||
font-size: 0.75em;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
|
||||
.docu-classes {
|
||||
background-color: #FEFBED;
|
||||
padding: 3px;
|
||||
color: #c6b256;
|
||||
font-family: "Courier New", Courier, monospace, sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
|
@ -1,974 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Icinga Documentation</title>
|
||||
|
||||
<link media="screen" href="bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="icinga-design.css">
|
||||
<link rel="stylesheet" href="documentation.css">
|
||||
<link rel="apple-touch-icon-precomposed" href="../apple-touch-icon-152×152-precomposed.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<!-- ######### Top Navbar ##########-->
|
||||
|
||||
<nav role="navigation" id="icingatopbar" class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand icinga-logo pull-left" href="/icinga2-web/">Icinga</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pull-left icinga-navbar icinga-navbar-hosts-container">
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-up">999/999</span>
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-unreachable">999/999</span>
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-down">999/999</span>
|
||||
</div>
|
||||
|
||||
<div class="pull-left icinga-navbar icinga-navbar-services-container">
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-ok">999/999</span>
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-critical">999/999</span>
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-warning">999/999</span>
|
||||
<span class="icinga-navbar-pills icinga-navbar-pills-unknown">999/999</span>
|
||||
</div>
|
||||
|
||||
<div class="pull-left icinga-navbar icinga-navbar-reload">
|
||||
<a class="button btn-common btn-small" href="#">
|
||||
<span class="icon-refresh icon-btn-small"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pull-left icinga-navbar icinga-navbar-search-container">
|
||||
<input type="text" class="form-control input-sm icinga-navbar-search" />
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
|
||||
<li class="dropdown">
|
||||
<a id="icinga_app_nav_useraction" data-toggle="dropdown" class="dropdown-toggle" href="#">
|
||||
<span id="icinga_app_nav_username">
|
||||
jdoe </span>
|
||||
<i class="icinga-icon-user"></i>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li id="icinga_app_nav_preferences">
|
||||
<a href="/icinga2-web/preference">Preferences </a>
|
||||
</li>
|
||||
<li id="icinga_app_nav_logout">
|
||||
<a title="Logout" href="/icinga2-web/authentication/logout">Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="docu-main">
|
||||
|
||||
<h1 class="docu-project-name">Icinga Documentation</h1>
|
||||
<!-- <div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div> -->
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Basic Elements</h1>
|
||||
|
||||
<h1 class="docu-sub-headline">Headlines</h1>
|
||||
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
<h1>Main headline h1</h1>
|
||||
<h2>Sub headline h2</h2>
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code"><h1>Main Headline H1</h1>
|
||||
<h2>Sub headline h2</h2>
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
<h1 class="docu-sub-headline">Textblocks</h1>
|
||||
<div class="docu-description">
|
||||
Used on simple pages with continuous text e.g. Imprint or Privacy.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At <a href="#">vero eos et accusam et justo</a> duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata <a href="#">sanctus est Lorem ipsum</a> dolor sit amet.
|
||||
</p>
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code">
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At <a href="#">vero eos et accusam et justo</a> duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata <a href="#">sanctus est Lorem ipsum</a> dolor sit amet.
|
||||
</p>
|
||||
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-sub-headline">Table</h1>
|
||||
<div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
|
||||
<th>Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/show/host?host=host_000" style="visibility:hidden"></a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
|
||||
<td title="UP since 2013-09-30 16:57:58">
|
||||
|
||||
<span class="badge-container_">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge pull-right">
|
||||
12
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
|
||||
<b>Up</b><br />
|
||||
Since
|
||||
30.09.
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000">
|
||||
<b>host_000</b>
|
||||
<i>127.0.0.1</i>
|
||||
</a><br />
|
||||
host_000 (checked by localhost.localdomain) OK: random hostcheck ok<br />
|
||||
<span class="output-text">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tacheader-status-unreachable">
|
||||
<a href="/icingawebinsfx/monitoring/show/host?host=host_000" style="visibility:hidden"></a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="icon-table icon-flapping"></div>
|
||||
<div class="icon-table icon-comment"></div>
|
||||
<div class="icon-table icon-unhandled"></div>
|
||||
</td>
|
||||
|
||||
<td title="UP since 2013-09-30 16:57:58">
|
||||
<span class="badge-container_">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge pull-right">
|
||||
6
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<b>Unreachable</b><br />
|
||||
Since
|
||||
30.09.
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000">
|
||||
<b>host_000</b>
|
||||
<i>127.0.0.1</i>
|
||||
</a><br />
|
||||
host_000 (checked by localhost.localdomain) OK: random hostcheck ok
|
||||
<span class="output-text">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tacheader-status-down">
|
||||
<a href="/icingawebinsfx/monitoring/show/host?host=host_000" style="visibility:hidden"></a>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td title="UP since 2013-09-30 16:57:58">
|
||||
<span class="badge-container_">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge pull-right">
|
||||
6
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<b>Down</b><br />
|
||||
Since
|
||||
30.09.
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000">
|
||||
<b>host_000</b>
|
||||
<i>127.0.0.1</i>
|
||||
</a><br />
|
||||
host_000 (checked by localhost.localdomain) OK: random hostcheck ok
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="">
|
||||
<a href="/icingawebinsfx/monitoring/show/host?host=host_000" style="visibility:hidden"></a>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td title="UP since 2013-09-30 16:57:58">
|
||||
<span class="badge-container_">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge pull-right">
|
||||
6
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<b>Up</b><br />
|
||||
Since
|
||||
30.09.
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000">
|
||||
<b>host_000</b>
|
||||
<i>127.0.0.1</i>
|
||||
</a><br />
|
||||
host_000 (checked by localhost.localdomain) OK: random hostcheck ok
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="">
|
||||
<a href="/icingawebinsfx/monitoring/show/host?host=host_000" style="visibility:hidden"></a>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
|
||||
<td title="UP since 2013-09-30 16:57:58">
|
||||
<span class="badge-container_">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge pull-right">
|
||||
6
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<b>Up</b><br />
|
||||
Since
|
||||
30.09.
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000">
|
||||
<b>host_000</b>
|
||||
<i>127.0.0.1</i>
|
||||
</a><br />
|
||||
host_000 (checked by localhost.localdomain) OK: random hostcheck ok
|
||||
<span class="output-text">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tacheader-status-down">
|
||||
<a href="/icingawebinsfx/monitoring/show/host?host=host_000" style="visibility:hidden"></a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="icon-table icon-flapping"></div>
|
||||
<div class="icon-table icon-comment"></div>
|
||||
<div class="icon-table icon-unhandled"></div>
|
||||
</td>
|
||||
|
||||
<td title="UP since 2013-09-30 16:57:58">
|
||||
<span class="badge-container_">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge pull-right">
|
||||
6
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<b>Down</b><br />
|
||||
Since
|
||||
30.09.
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000">
|
||||
<b>host_000</b>
|
||||
<i>127.0.0.1</i>
|
||||
</a><br />
|
||||
host_000 (checked by localhost.localdomain) OK: random hostcheck ok
|
||||
<span class="output-text">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code">
|
||||
code...
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Pagination</h1>
|
||||
|
||||
<div class="docu-description">
|
||||
The pagination is placed on top and bottom of every list.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
<ul class="pagination pagination-sm">
|
||||
<!-- Previous page link -->
|
||||
|
||||
<li class="disabled"><span>« Prev</span></li>
|
||||
|
||||
<!-- Numbered page links -->
|
||||
<li class="active">
|
||||
<a title="1 to 20 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=1">
|
||||
1 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="21 to 40 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=2">
|
||||
2 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="41 to 60 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=3">
|
||||
3 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="61 to 80 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=4">
|
||||
4 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="81 to 100 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=5">
|
||||
5 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="101 to 111 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=6">
|
||||
6 </a>
|
||||
</li>
|
||||
<!-- Next page link -->
|
||||
<li>
|
||||
<a title="21 to 40 of 111" href="/icinga2-web/monitoring/list/hosts?detail=%2Ficinga2-web%2Fmonitoring%2Fshow%2Fhost%3Fhost%3Dhost_001&page=2">Next »
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code">Code... Code...
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Details</h1>
|
||||
|
||||
<h1 class="docu-sub-headline">Basic Example</h1>
|
||||
<div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
|
||||
<div class="panel-heading border-status-critical">
|
||||
<div class="panel-hostname">
|
||||
Host Status host_000 ölaierjoe paeurüuaeraeüure <span class="panel-header-status">- Unreachable since 15:59</span></div>
|
||||
</div>
|
||||
<hr class="separator" />
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="panel-row">
|
||||
<p>host_000 (checked by localhost.localdomain) OK: random hostcheck ok sometimes with multiline and html tags\n </p>
|
||||
</div>
|
||||
|
||||
<div class="panel-row">
|
||||
<a href="#" class="button btn-cta btn-wide">Recheck</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-row">
|
||||
<div class="panel-label">
|
||||
Last Check
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
1381308168
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-row">
|
||||
<div class="panel-label">
|
||||
Next Check
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
1381309978
|
||||
</div>
|
||||
<div class="panel-button">
|
||||
<a href="#" class="button btn-common btn-small"><span class="icon-reschedule icon-btn-small"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-row">
|
||||
<div class="panel-label">
|
||||
Host Address
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
127.0.0.1
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-row">
|
||||
<div class="panel-label">
|
||||
Alias
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
random_000
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-row">
|
||||
<a href="#" class="button btn-common btn-half-left">View Services For This Host </a>
|
||||
<a href="#" class="button btn-common btn-half-right">Recheck All Services</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- ########## Box mit Tabelle ############# -->
|
||||
|
||||
<div class="panel-heading">
|
||||
<div class="panel-hostname">
|
||||
Box mit Tabelle</div>
|
||||
</div>
|
||||
<hr class="separator" />
|
||||
|
||||
<div class="panel-body">
|
||||
<table class="table table-condensed table-detail">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Lorem</th>
|
||||
<th>Ipsum xyz</th>
|
||||
<th>blablubb</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>08.10. 15:51</td>
|
||||
<td><a href="#">Lorem ipusm_002</a></td>
|
||||
<td><a href="#" class="button btn-common btn-small pull-right"><span class="icon-downtime icon-btn-small"></span></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>08.10. 15:51</td>
|
||||
<td>Ich bin ein toller Text</td>
|
||||
<td><a href="#" class="button btn-common btn-small pull-right"><span class="icon-edit icon-btn-small"></span></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Hallo hallo</td>
|
||||
<td>Server 123 blabla</td>
|
||||
<td>Noch ein Text</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Lorem ipsum</td>
|
||||
<td>Juhuhallo_host01</td>
|
||||
<td>128747404</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- ########## Heading ############# -->
|
||||
|
||||
<div class="panel-heading">
|
||||
<div class="panel-hostname">
|
||||
Heading</div>
|
||||
</div>
|
||||
<hr class="separator" />
|
||||
|
||||
<div class="panel-body">
|
||||
<table class="table table-condensed table-detail">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>Passive Checks</td>
|
||||
<td><div class="icon-table-hint icon-edit pull-left"></div></td>
|
||||
<td><input type="checkbox" id="#" name="#" class="pull-right" checked /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Active Checks</td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" id="#" name="#" class="pull-right" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Obsessing</td>
|
||||
<td><div class="icon-table-hint icon-edit pull-left"></div></td>
|
||||
<td><input type="checkbox" id="#" name="#" class="pull-right" checked /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Notifications</td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" id="#" name="#" class="pull-right" checked /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Event Handler</td>
|
||||
<td><div class="icon-table-hint icon-edit pull-left"></div></td>
|
||||
<td><input type="checkbox" id="#" name="#" class="pull-right" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flap Detection</td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" id="#" name="#" class="pull-right" /></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code">Code... Code...
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Form Elements</h1>
|
||||
|
||||
<h1 class="docu-sub-headline">Select</h1>
|
||||
<div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
|
||||
<form data-icinga-component="app/form" action="" method="get" class="form-inline" name="hosts" id="icinga-component-0">
|
||||
<div id="sort-element" class="form-group">
|
||||
<label for="sort">Sort By</label>
|
||||
<select data-icinga-form-autosubmit="1" class="form-control input-sm" id="sort" name="sort">
|
||||
<option value="host_last_check">Last Host Check</option>
|
||||
<option value="host_severity">Host Severity</option>
|
||||
<option value="host_state">Hard State</option>
|
||||
<option value="host_name">Host Name</option>
|
||||
<option value="host_address">Address</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="dir-element" class="form-group"><label for="dir"> </label>
|
||||
<select data-icinga-form-autosubmit="1" class="form-control input-sm" id="dir" name="dir">
|
||||
<option value="desc">Desc</option>
|
||||
<option value="asc">Asc</option>
|
||||
</select></div>
|
||||
<div id="submit_hosts-element" class="form-group"><label for="submit_hosts"> </label><noscript>
|
||||
<input type="submit" name="submit_hosts" id="submit_hosts" value="Sort" class="btn btn-default form-control input-sm" condition="0" addLabelPlaceholder="1"></noscript>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code">
|
||||
...
|
||||
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Main Navigation</h1>
|
||||
|
||||
<h1 class="docu-sub-headline">Without Subnavigation</h1>
|
||||
<div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
<ul id="icinganavigation" role="navigation" class="nav nav-stacked">
|
||||
<li class="icon-main-nav nav-icon-hosts">
|
||||
<a href="/icinga2-web/monitoring/list/hosts">Hosts</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-services">
|
||||
<a href="/icinga2-web/monitoring/list/services" class="nav-notification">Services</a>
|
||||
<span class="badge-container-nav">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge-nav">
|
||||
12
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-downtimes">
|
||||
<a href="/icinga2-web/monitoring/list/downtimes">Downtimes</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-notifications">
|
||||
<a href="/icinga2-web/monitoring/list/notifications">Notifications</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-comments">
|
||||
<a href="/icinga2-web/monitoring/list/comments">Comments</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-dashboard active">
|
||||
<a href="/icinga2-web/dashboard/index">Dashboard</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-configuration">
|
||||
<a href="/icinga2-web/config/index">Configuration</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-sub-headline">With Subnavigation</h1>
|
||||
<div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
<ul id="icinganavigation" role="navigation" class="nav nav-stacked">
|
||||
<li class="icon-main-nav nav-icon-hosts">
|
||||
<a href="/icinga2-web/monitoring/list/hosts">Hosts</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-services">
|
||||
<a href="/icinga2-web/monitoring/list/services" class="nav-notification">Services</a>
|
||||
<span class="badge-container-nav">
|
||||
<a href="/icingawebinsfx/monitoring/list/services?host=host_000&service_problems=1" class="badge-nav">
|
||||
12
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-downtimes">
|
||||
<a href="/icinga2-web/monitoring/list/downtimes">Downtimes</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-notifications">
|
||||
<a href="/icinga2-web/monitoring/list/notifications">Notifications</a>
|
||||
</li>
|
||||
|
||||
<!-- ##### Sub Nav ######## -->
|
||||
<ul class="icinga-subnavigation">
|
||||
<li class="icon-main-nav subnav-icon-configuration">
|
||||
<a href="#">Lorem Ipsum lorem</a>
|
||||
</li>
|
||||
<li class="icon-main-nav subnav-icon-configuration">
|
||||
<a href="#" class="nav-notification">Submenüpunkt 2</a>
|
||||
<span class="badge-container-subnav">
|
||||
<a href="#" class="badge-subnav">
|
||||
12
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<li class="icon-main-nav subnav-icon-configuration active">
|
||||
<a href="#">Dritter toller Punkt</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<li class="icon-main-nav nav-icon-comments">
|
||||
<a href="/icinga2-web/monitoring/list/comments">Comments</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-dashboard">
|
||||
<a href="/icinga2-web/dashboard/index">Dashboard</a>
|
||||
</li>
|
||||
<li class="icon-main-nav nav-icon-configuration">
|
||||
<a href="/icinga2-web/config/index">Configuration</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Dashboard</h1>
|
||||
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
|
||||
<div class="dashboard-container">
|
||||
<table class="table table-condensed table-detail table-dashboard">
|
||||
|
||||
<thead class="sep">
|
||||
<tr>
|
||||
<th colspan="3" class="test">
|
||||
<a href="#">Dies ist eine tolle Headline</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="border-status-critical">09.10. 17:40</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
<i class="dashboard-icons icon-flapping"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Service</strong></a> on <a href="#">Hosta</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-status-unknown">unknown</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_123456</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-status-warning">11.10.</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
<i class="dashboard-icons icon-flapping"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>random_06</strong></a> on <a href="#">Host_insertEFFECT</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border-status-unknown">unknown</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_123456</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border-status-unknown">unknown</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_123456</a></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="dashboard-container">
|
||||
<table class="table table-condensed table-detail">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="3" class="test">
|
||||
<a href="#">Dies ist eine tolle Headline</a>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-status-critical">09.10.</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
<i class="dashboard-icons icon-flapping"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_0815</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-status-unknown">unknown</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_123456</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-status-warning">11.10.</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
<i class="dashboard-icons icon-flapping"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>random_06</strong></a> on <a href="#">Host_insertEFFECT</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border-status-unknown">unknown</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_123456</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border-status-unknown">unknown</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>Ping</strong></a> on <a href="#">Host_123456</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border-status-warning">11.10.</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
<i class="dashboard-icons icon-flapping"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>random_06</strong></a> on <a href="#">Host_insertEFFECT</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border-status-warning">11.10.</td>
|
||||
<td>
|
||||
<i class="dashboard-icons icon-unhandled"></i>
|
||||
<i class="dashboard-icons icon-flapping"></i>
|
||||
<i class="dashboard-icons icon-comment"></i>
|
||||
</td>
|
||||
<td><a href="#"><strong>random_06</strong></a> on <a href="#">Host_insertEFFECT</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="docu-main-headline">Main Header</h1>
|
||||
|
||||
<h1 class="docu-sub-headline">Sub Header</h1>
|
||||
<div class="docu-description">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
||||
</div>
|
||||
|
||||
<div class="docu-section">
|
||||
<div class="docu-example">
|
||||
<div class="docu-module">
|
||||
<h1>bla</h1>
|
||||
<h2>blubb</h2>
|
||||
</div><!-- .docu-module -->
|
||||
</div><!-- .docu-example -->
|
||||
|
||||
<div class="docu-codeblock">
|
||||
<textarea class="docu-code">Code... Code...
|
||||
</textarea>
|
||||
</div><!-- .docu-codeblock -->
|
||||
</div><!-- .docu-section -->
|
||||
|
||||
|
||||
|
||||
<!-- END CONTENT ####################### -->
|
||||
|
||||
<div class="docu-footer">
|
||||
09/2013 - insertEFFECT GmbH
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- .docu-main -->
|
||||
|
||||
<script src="../js/vendor/requirejs/require.js" data-main="../js/main"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,955 +0,0 @@
|
|||
/* ==========================================================================
|
||||
Icinga Design
|
||||
========================================================================== */
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
color: #262625;
|
||||
font-family: "Lucida Grande","Lucida Sans Unicode",Verdana,Helvetica,Arial,sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.gap {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
a {
|
||||
color: #049baf;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
color: #049baf;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
color: #262625;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #262625;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
|
||||
table, th, td {
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
th {
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
padding: 8px 8px 10px 8px;
|
||||
border-bottom: 2px solid #ddd;
|
||||
}
|
||||
|
||||
.table-detail th {
|
||||
font-size: 16px;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
|
||||
.table-detail thead > tr > th, .table tbody > tr > th,
|
||||
.table-detail tbody > tr > td, .table tfoot > tr > td {
|
||||
border-top: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.table-detail > thead {
|
||||
border-top: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
td {
|
||||
padding: 8px 10px 8px 8px !important;
|
||||
border-bottom: 1px dotted #ddd !important;
|
||||
border-top: none;
|
||||
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
float: right !important;
|
||||
clear: right !important;
|
||||
|
||||
display: block;
|
||||
clear: right;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.badge-container {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.badge {
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
color: #ff3300;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
min-width: 10px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 3px;
|
||||
text-align: center;
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
border: 1px solid #ff3300;
|
||||
|
||||
}
|
||||
|
||||
.badge a,
|
||||
.badge a:active,
|
||||
.badge a:hover,
|
||||
.badge:hover {
|
||||
color: #ff3300 !important;
|
||||
display: inline-block !important;
|
||||
|
||||
}
|
||||
|
||||
.host-name {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.active {
|
||||
background-color: #f5f5f5;
|
||||
|
||||
}
|
||||
|
||||
.output-text {
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.panel-disabled {
|
||||
border-left: 8px solid #FF3300;
|
||||
}
|
||||
|
||||
.panel-enabled {
|
||||
border-left: 8px solid #00CC33;
|
||||
}
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
|
||||
.form-inline .form-group {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.input-sm {
|
||||
border-radius: 3px;
|
||||
font-size: 16px;
|
||||
|
||||
|
||||
padding: 5px;
|
||||
margin-right: 15px;
|
||||
|
||||
}
|
||||
.form-control {
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #CCCCCC;
|
||||
border-radius: 4px;
|
||||
padding: 5px;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
|
||||
color: #555555;
|
||||
display: block;
|
||||
|
||||
|
||||
|
||||
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
select.input-sm {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Pagination
|
||||
========================================================================== */
|
||||
|
||||
.pagination > .active > a,
|
||||
.pagination > .active > span,
|
||||
.pagination > .active > a:hover,
|
||||
.pagination > .active > span:hover,
|
||||
.pagination > .active > a:focus,
|
||||
.pagination > .active > span:focus {
|
||||
|
||||
background-color: #049baf !important;
|
||||
border-color: fuchsia !important;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.pagination-sm > li > a, .pagination-sm > li > span {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Status colors
|
||||
========================================================================== */
|
||||
|
||||
.status-up {
|
||||
background-color: #00cc33; /* green */
|
||||
}
|
||||
|
||||
.status-warning {
|
||||
background-color: #00cc33; /* xx */
|
||||
}
|
||||
|
||||
.status-critical {
|
||||
background-color: #ff3300; /* red */
|
||||
}
|
||||
|
||||
.status-unknown {
|
||||
background-color: #00cc33; /* xx */
|
||||
}
|
||||
|
||||
.status-pending {
|
||||
background-color: #00cc33; /* xx */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Service status **/
|
||||
|
||||
.tacheader-status-critical {
|
||||
background-color: #FF3300;
|
||||
}
|
||||
|
||||
.tacheader-status-ok {
|
||||
background-color: #00CC33;
|
||||
}
|
||||
|
||||
.tacheader-status-warning {
|
||||
background-color: #FFA500;
|
||||
}
|
||||
|
||||
.tacheader-status-unknown {
|
||||
background-color: #E066FF;
|
||||
}
|
||||
|
||||
/** Host status **/
|
||||
|
||||
.tacheader-status-unreachable {
|
||||
background-color: #E066FF;
|
||||
}
|
||||
|
||||
.tacheader-status-down {
|
||||
background-color: #FF3300;
|
||||
}
|
||||
|
||||
.tacheader-status-up {
|
||||
background-color: #00CC33;
|
||||
}
|
||||
|
||||
|
||||
/* Borders for Detail Headers */
|
||||
|
||||
.border-status-critical {
|
||||
border-left: 10px solid #FF3300;
|
||||
}
|
||||
|
||||
.border-status-ok {
|
||||
border-left: 10px solid #00CC33;
|
||||
}
|
||||
|
||||
.border-status-warning {
|
||||
border-left: 10px solid #FFA500;
|
||||
}
|
||||
|
||||
.border-status-unknown {
|
||||
border-left: 10px solid #E066FF;
|
||||
}
|
||||
|
||||
/** Host status **/
|
||||
|
||||
.border-status-unreachable {
|
||||
border-left: 10px solid #E066FF;
|
||||
}
|
||||
|
||||
.border-status-down {
|
||||
border-left: 10px solid #FF3300;
|
||||
}
|
||||
|
||||
.border-status-up {
|
||||
background-color: #00CC33;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Icons
|
||||
========================================================================== */
|
||||
|
||||
.icon-table {
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
display: block;
|
||||
background-position: 50% 0;
|
||||
}
|
||||
|
||||
.icon-header {
|
||||
background-position: 0 50%;
|
||||
padding-left: 25px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.icon-btn-small {
|
||||
background-position: 0 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.icon-table-hint {
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
display: block;
|
||||
background-position: 50% 50%;
|
||||
}
|
||||
.icon-table-hint:after {
|
||||
content: "edited";
|
||||
padding-left: 22px;
|
||||
}
|
||||
|
||||
|
||||
.icon-flapping {
|
||||
background-image: url('images/flapping.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-comment {
|
||||
background-image: url('images/comment.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-unhandled {
|
||||
background-image: url('images/unhandled.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-host {
|
||||
background-image: url('images/host.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-acknowledgement {
|
||||
background-image: url('images/acknowledgement.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-remove {
|
||||
background-image: url('images/remove.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-submit {
|
||||
background-image: url('images/submit.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-create {
|
||||
background-image: url('images/create.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-dashboard {
|
||||
background-image: url('images/dashboard.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-disable {
|
||||
background-image: url('images/disable.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-edit {
|
||||
background-image: url('images/edit.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-error {
|
||||
background-image: url('images/error.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-downtime {
|
||||
background-image: url('images/in_downtime.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-save {
|
||||
background-image: url('images/save.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-service {
|
||||
background-image: url('images/service.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-user {
|
||||
background-image: url('images/user.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-reschedule {
|
||||
background-image: url('images/reschedule.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.icon-refresh {
|
||||
background-image: url('images/refresh.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Details Panel
|
||||
========================================================================== */
|
||||
|
||||
|
||||
.panel-heading {
|
||||
border-bottom: 0;
|
||||
margin-bottom: 0px !important;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 3px;
|
||||
padding-top: 5px;
|
||||
overflow: hidden;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.panel-hostname {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.separator {
|
||||
border-top: 2px solid #ddd;
|
||||
border-bottom: 0;
|
||||
margin: 0;
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
.panel-header-status {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.panel-row {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
border-bottom: 1px dotted #ddd;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.panel-label {
|
||||
float: left;
|
||||
padding-right: 10px;
|
||||
width: 30%;
|
||||
clear: left;
|
||||
|
||||
}
|
||||
.panel-content {
|
||||
float: left;
|
||||
padding-right: 10px;
|
||||
display: inline-block;
|
||||
max-width: 40%;
|
||||
}
|
||||
|
||||
.panel-button {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
margin-bottom: 45px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Buttons
|
||||
========================================================================== */
|
||||
|
||||
.button {
|
||||
text-align: center;
|
||||
padding: 3px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.btn-common {
|
||||
border-color: #ddd;
|
||||
color: #262625;
|
||||
background: rgb(255,255,255); /* Old browsers */
|
||||
background: -moz-linear-gradient(top, rgb(255,255,255) 1%, rgb(245,245,245) 100%); /* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgb(255,255,255)), color-stop(100%,rgb(245,245,245))); /* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* IE10+ */
|
||||
background: linear-gradient(to bottom, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* W3C */
|
||||
}
|
||||
|
||||
.panel-row > a:hover,
|
||||
.btn-common:hover {
|
||||
border-color: #262625 !important;
|
||||
color: #262625 !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
.btn-cta {
|
||||
border-color: #049BAF;
|
||||
color: #049BAF;
|
||||
background: rgb(255,255,255); /* Old browsers */
|
||||
background: -moz-linear-gradient(top, rgb(255,255,255) 1%, rgb(245,245,245) 100%); /* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgb(255,255,255)), color-stop(100%,rgb(245,245,245))); /* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* IE10+ */
|
||||
background: linear-gradient(to bottom, rgb(255,255,255) 1%,rgb(245,245,245) 100%); /* W3C */
|
||||
}
|
||||
|
||||
|
||||
|
||||
.btn-small {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.btn-wide {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.btn-half-left {
|
||||
float: left;
|
||||
width: 48%;
|
||||
}
|
||||
.btn-half-right {
|
||||
float: right;
|
||||
width: 48%;
|
||||
}
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Main Navigation
|
||||
========================================================================== */
|
||||
|
||||
|
||||
.nav-stacked > li + li {
|
||||
margin-left: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
.nav-stacked {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.icinga-subnavigation {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.nav-stacked > li {
|
||||
padding-top: 7px;
|
||||
padding-bottom: 7px;
|
||||
border-bottom: 1px dotted #049baf;
|
||||
border-right: 1px dotted #049baf;
|
||||
}
|
||||
.nav-stacked > li:first-child {
|
||||
border-top: 1px dotted #049baf;
|
||||
}
|
||||
|
||||
|
||||
.icinga-subnavigation > li {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px dotted #049baf;
|
||||
border-right: 1px dotted #049baf;
|
||||
}
|
||||
|
||||
ul.icinga-subnavigation {
|
||||
|
||||
border-bottom: 1px dotted #049baf;
|
||||
margin-left: 0;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.icinga-subnavigation > li:last-child {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 0;
|
||||
|
||||
}
|
||||
|
||||
.nav-stacked > li > a,
|
||||
.icinga-subnavigation > li > a {
|
||||
padding-left: 40px;
|
||||
padding-right: 3px;
|
||||
border-left: 6px solid #049baf;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.nav-stacked > li > a.nav-notification,
|
||||
.icinga-subnavigation > li > a.nav-notification {
|
||||
border-left: 6px solid red !important;
|
||||
}
|
||||
|
||||
.nav-stacked > li > a:hover,
|
||||
.icinga-subnavigation > li > a:focus {
|
||||
/* font-weight: bold;*/
|
||||
background-color: transparent !important;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.nav-stacked > li:hover,
|
||||
.nav-stacked > li:focus,
|
||||
.icinga-subnavigation > li:hover,
|
||||
.icinga-subnavigation > li:focus {
|
||||
background-color: #fff;
|
||||
|
||||
}
|
||||
|
||||
.nav-stacked > li.active,
|
||||
.icinga-subnavigation > li.active {
|
||||
background-color: #fff;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.nav-icon-hosts {
|
||||
background-image: url('images/host_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
|
||||
.nav-icon-services {
|
||||
background-image: url('images/service_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
.nav-icon-downtimes {
|
||||
background-image: url('images/in_downtime_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
.nav-icon-notifications {
|
||||
background-image: url('images/notification_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 20px;
|
||||
}
|
||||
.nav-icon-comments {
|
||||
background-image: url('images/comment_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
.nav-icon-dashboard {
|
||||
background-image: url('images/dashboard_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
.nav-icon-configuration {
|
||||
background-image: url('images/configuration_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
|
||||
|
||||
.subnav-icon-configuration {
|
||||
background-image: url('images/configuration_petrol.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 19px 50%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.badge-container-nav {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding-top: 0;
|
||||
margin-bottom: 5px;
|
||||
|
||||
}
|
||||
.badge-nav {
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
color: #ff3300;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
min-width: 10px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
padding-top: 3px;
|
||||
text-align: center;
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
border: 1px solid #ff3300;
|
||||
}
|
||||
|
||||
.badge-container-subnav {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-top: 0;
|
||||
margin-left: 2px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.badge-subnav {
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
color: #ff3300;
|
||||
display: inline-block;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
min-width: 10px;
|
||||
padding-bottom: 2px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 2px;
|
||||
text-align: center;
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
border: 1px solid #ff3300;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Dashboard
|
||||
========================================================================== */
|
||||
|
||||
.dashboard-container {
|
||||
|
||||
margin-right: 40px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
|
||||
}
|
||||
|
||||
.dashboard-icons {
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
Top Navbar
|
||||
========================================================================== */
|
||||
|
||||
|
||||
.icinga-logo {
|
||||
background-attachment: scroll;
|
||||
background-clip: border-box;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
background-image: url("images/logo_icinga.png");
|
||||
background-origin: padding-box;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto auto;
|
||||
display: block;
|
||||
height: 33px;
|
||||
margin-bottom: 0;
|
||||
margin-left: 8px;
|
||||
margin-right: 30px;
|
||||
margin-top: 8px;
|
||||
text-indent: -999px;
|
||||
width: 94px;
|
||||
}
|
||||
|
||||
.icinga-icon-user {
|
||||
background-attachment: scroll;
|
||||
background-clip: border-box;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
background-image: url("images/user.png");
|
||||
background-origin: padding-box;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto auto;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.icinga-navbar {
|
||||
margin-right: 15px;
|
||||
}
|
||||
.icinga-navbar-reload {
|
||||
margin-top: 13px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.icinga-navbar-search {
|
||||
background-image: url('images/search.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5px 50%;
|
||||
padding-left: 25px !important;
|
||||
}
|
||||
|
||||
.icinga-navbar-search-container {
|
||||
border-left: 1px solid #ddd;
|
||||
padding-left: 15px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.icinga-navbar-hosts-container {
|
||||
background-image: url('images/host.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5px 50%;
|
||||
padding-left: 30px !important;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.icinga-navbar-services-container {
|
||||
background-image: url('images/service.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5px 50%;
|
||||
padding-left: 25px !important;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.icinga-navbar-pills {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 3px 5px 3px 5px;
|
||||
border-radius: 3px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Service status **/
|
||||
|
||||
.icinga-navbar-pills-critical {
|
||||
border-color: #FF3300;
|
||||
color: #FF3300;
|
||||
}
|
||||
|
||||
.icinga-navbar-pills-ok {
|
||||
border-color: #00CC33;
|
||||
color: #00CC33;
|
||||
}
|
||||
|
||||
.icinga-navbar-pills-warning {
|
||||
border-color: #FFA500;
|
||||
color: #FFA500;
|
||||
}
|
||||
|
||||
.icinga-navbar-pills-unknown {
|
||||
border-color: #E066FF;
|
||||
color: #E066FF;
|
||||
}
|
||||
|
||||
/** Host status **/
|
||||
|
||||
.icinga-navbar-pills-unreachable {
|
||||
border-color: #E066FF;
|
||||
color: #E066FF;
|
||||
}
|
||||
|
||||
.icinga-navbar-pills-down {
|
||||
border-color: #FF3300;
|
||||
color: #FF3300;
|
||||
}
|
||||
|
||||
.icinga-navbar-pills-up {
|
||||
border-color: #00CC33;
|
||||
color: #00CC33;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 502 B |
Before Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 415 B |
Before Width: | Height: | Size: 420 B |
Before Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 489 B |
Before Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 497 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 523 B |
Before Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 400 B |
Before Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 496 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 487 B |
140
doc/resources.md
|
@ -1,96 +1,84 @@
|
|||
# Resources
|
||||
# <a id="resources"></a> Resources
|
||||
|
||||
The configuration file *config/resources.ini* contains data sources that can be referenced
|
||||
in other configurations. This allows you to manage all connections to databases at one central
|
||||
place, avoiding the need to edit several different files, when the connection information of a resource change.
|
||||
The INI configuration file **config/resources.ini** contains information about data sources that can be referenced in other
|
||||
configuration files. This allows you to manage all data sources at one central place, avoiding the need to edit several
|
||||
different files, when the information about a data source changes.
|
||||
|
||||
## Configuration
|
||||
## <a id="resources-configuration"></a> Configuration
|
||||
|
||||
Each section represents a resource, with the section name being the identifier used to
|
||||
reference this certain section. Depending on the resource type, each section contains different properties.
|
||||
The property *type* defines the resource type and thus how the properties are going to be interpreted.
|
||||
The available resource types are 'db', 'statusdat', 'livestatus' and 'ldap' and are
|
||||
described in detail in the following sections:
|
||||
Each section in **config/resources.ini** represents a data source with the section name being the identifier used to
|
||||
reference this specific data source. Depending on the data source type, the sections define different directives.
|
||||
The available data source types are *db*, *ldap* and *livestatus* which will described in detail in the following
|
||||
paragraphs.
|
||||
|
||||
### db
|
||||
### <a id="resources-configuration-database"></a> Database
|
||||
|
||||
This resource type describes a SQL database on an SQL server. Databases can contain users and groups
|
||||
to handle authentication and permissions, or monitoring data using IDO.
|
||||
A Database resource defines a connection to a SQL databases which can contain users and groups
|
||||
to handle authentication and authorization, monitoring data or user preferences.
|
||||
|
||||
- *db*: defines the used database vendor, which could be a value like *mysql* or *pgsql*.
|
||||
- *host*: The hostname that is used to connect to the database.
|
||||
- *port*: The port that is used to connect to the database.
|
||||
- *username*: The user name that is used to authenticate.
|
||||
- *password*: The password of the user given in *username*.
|
||||
- *dbname*: The name of the database that contains the resources data.
|
||||
Directive | Description
|
||||
----------------|------------
|
||||
**type** | `db`
|
||||
**db** | Database management system. Either `mysql` or `pgsql`.
|
||||
**host** | Connect to the database server on the given host.
|
||||
**port** | Port number to use for the connection.
|
||||
**username** | The username to use when connecting to the server.
|
||||
**password** | The password to use when connecting to the server.
|
||||
**dbname** | The database to use.
|
||||
|
||||
### ldap
|
||||
**Example:**
|
||||
|
||||
The resource is a tree in a ldap domain. This resource type is usually used to fetch users and groups
|
||||
to handle authentication and permissions.
|
||||
|
||||
- *hostname*: The hostname that is used to connect to the ldap server.
|
||||
- *port*: The port that is used to connect to the ldap server.
|
||||
- *root_dn*: The root object of the tree. This is usually an organizational unit like
|
||||
"ou=people, dc=icinga, dc=org".
|
||||
- *bind_dn*: The user on the LDAP server that will be used to access it. Usually something
|
||||
like "cn=admin, cn=config".
|
||||
- *bind_pw*: The password of the user given in *bind_dn*.
|
||||
```
|
||||
[icingaweb]
|
||||
type = db
|
||||
db = mysql
|
||||
host = localhost
|
||||
port = 3306
|
||||
username = icingaweb
|
||||
password = icingaweb
|
||||
dbname = icingaweb
|
||||
```
|
||||
|
||||
|
||||
### livestatus
|
||||
### <a id="resources-configuration-ldap"></a> LDAP
|
||||
|
||||
A resource that points to a livestatus socket. This resource type contains monitoring data.
|
||||
A LDAP resource represents a tree in a LDAP directory. LDAP is usually used for authentication and authorization.
|
||||
|
||||
- *socket*: The livestatus socket. Can be either be a path to a domain socket (like
|
||||
"/usr/local/icinga-mysql/var/rw/live") or to a TCP socket like
|
||||
(tcp://<domain>:<port>)
|
||||
Directive | Description
|
||||
----------------|------------
|
||||
**type** | `ldap`
|
||||
**hostname** | Connect to the LDAP server on the given host.
|
||||
**port** | Port number to use for the connection.
|
||||
**root_dn** | Root object of the tree, e.g. "ou=people,dc=icinga,dc=org"
|
||||
**bind_dn** | The user to use when connecting to the server.
|
||||
**bind_pw** | The password to use when connecting to the server.
|
||||
|
||||
### statusdat
|
||||
**Example:**
|
||||
|
||||
A resource that points to statusdat files. This resource type contains monitoring data.
|
||||
|
||||
- *status_file*: The path to the *status.dat* file, like "/usr/local/icinga-mysql/var/status.dat"
|
||||
- *object_file*: The path to *objects.cache*, like "/usr/local/icinga-mysql/var/objects.cache"
|
||||
````
|
||||
[ad]
|
||||
type = ldap
|
||||
hostname = localhost
|
||||
port = 389
|
||||
root_dn = "ou=people,dc=icinga,dc=org"
|
||||
bind_dn = "cn=admin,ou=people,dc=icinga,dc=org"
|
||||
bind_pw = admin`
|
||||
````
|
||||
|
||||
|
||||
## Factory Implementations
|
||||
### <a id="resources-configuration-livestatus"></a> Livestatus
|
||||
|
||||
This section contains documentation documentation for the Icinga2-Web developers that want to
|
||||
use resources defined in the *resources.ini*. Each supported resource type should have an own
|
||||
factory class, that can be used to comfortably create instances of classes that provide access
|
||||
to the data of the resources.
|
||||
A Livestatus resource represents the location of a Livestatus socket which is used for fetching monitoring data.
|
||||
|
||||
Directive | Description
|
||||
----------------|------------
|
||||
**type** | `livestatus`
|
||||
**socket** | Location of the Livestatus socket. Either a path to a local Livestatus socket or a path to a remote Livestatus socket in the format `tcp://<host>:<port>`.
|
||||
|
||||
### ResourceFactory
|
||||
**Example:**
|
||||
|
||||
The ResourceFactory can be used to retrieve objects to access resources. Lets assume
|
||||
for the following examples, that we have an *resources.ini* that looks like this:
|
||||
|
||||
[statusdat]
|
||||
type = statusdat
|
||||
status_file = /usr/local/icinga-mysql/var/status.dat
|
||||
object_file = /usr/local/icinga-mysql/var/objects.cache
|
||||
|
||||
[ldap_authentication]
|
||||
type = "ldap"
|
||||
hostname = "localhost"
|
||||
port = "389"
|
||||
root_dn = "ou=people, dc=icinga, dc=org"
|
||||
bind_dn = "cn=admin, cn=config"
|
||||
bind_pw = "admin"
|
||||
|
||||
|
||||
Here is an example of how to retrieve the resource 'statusdat' from the factory.
|
||||
|
||||
$resource = ResourceFactory::createResource(
|
||||
ResourceFactory::getResourceConfig('statusdat')
|
||||
);
|
||||
|
||||
If you specify a resource that does not exist or has the wrong type,
|
||||
the factory will throw an ConfigurationException.
|
||||
|
||||
|
||||
You can also retrieve a list of all available resources by calling *getResourceConfigs*.
|
||||
|
||||
$resourceConfigs = ResourceFactory::getResourceConfigs();
|
||||
````
|
||||
[livestatus]
|
||||
type = livestatus
|
||||
socket = /var/run/icinga2/cmd/livestatus
|
||||
````
|
||||
|
|
|
@ -8,6 +8,7 @@ use ErrorException;
|
|||
use Exception;
|
||||
use LogicException;
|
||||
use Icinga\Application\Modules\Manager as ModuleManager;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\NotReadableError;
|
||||
|
@ -372,7 +373,7 @@ abstract class ApplicationBootstrap
|
|||
$this->moduleManager = new ModuleManager(
|
||||
$this,
|
||||
$this->configDir . '/enabledModules',
|
||||
explode(':', $this->config->fromSection('global', 'module_path', $this->baseDir . '/modules'))
|
||||
explode(':', $this->config->get('global', 'module_path', $this->baseDir . '/modules'))
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
@ -415,7 +416,7 @@ abstract class ApplicationBootstrap
|
|||
protected function setupLogging()
|
||||
{
|
||||
Logger::create(
|
||||
new Config(
|
||||
new ConfigObject(
|
||||
array(
|
||||
'log' => 'syslog'
|
||||
)
|
||||
|
@ -476,9 +477,9 @@ abstract class ApplicationBootstrap
|
|||
*/
|
||||
protected function setupLogger()
|
||||
{
|
||||
if (($loggingConfig = $this->config->logging) !== null) {
|
||||
if ($this->config->hasSection('logging')) {
|
||||
try {
|
||||
Logger::create($loggingConfig);
|
||||
Logger::create($this->config->getSection('logging'));
|
||||
} catch (ConfigurationError $e) {
|
||||
Logger::error($e);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
namespace Icinga\Application;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Platform;
|
||||
use Icinga\Application\ApplicationBootstrap;
|
||||
use Icinga\Cli\Params;
|
||||
|
@ -12,6 +11,7 @@ use Icinga\Cli\Loader;
|
|||
use Icinga\Cli\Screen;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Application\Benchmark;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
|
||||
require_once __DIR__ . '/ApplicationBootstrap.php';
|
||||
|
@ -50,7 +50,7 @@ class Cli extends ApplicationBootstrap
|
|||
protected function setupLogging()
|
||||
{
|
||||
Logger::create(
|
||||
new Config(
|
||||
new ConfigObject(
|
||||
array(
|
||||
'level' => Logger::INFO,
|
||||
'log' => 'stdout',
|
||||
|
|
|
@ -6,15 +6,14 @@ namespace Icinga\Application;
|
|||
|
||||
use Iterator;
|
||||
use Countable;
|
||||
use ArrayAccess;
|
||||
use LogicException;
|
||||
use UnexpectedValueException;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Exception\NotReadableError;
|
||||
|
||||
/**
|
||||
* Container for configuration values and global registry of application and module related configuration.
|
||||
* Container for INI like configuration and global registry of application and module related configuration.
|
||||
*/
|
||||
class Config implements Countable, Iterator, ArrayAccess
|
||||
class Config implements Countable, Iterator
|
||||
{
|
||||
/**
|
||||
* Configuration directory where ALL (application and module) configuration is located
|
||||
|
@ -38,14 +37,14 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
protected static $modules = array();
|
||||
|
||||
/**
|
||||
* This config's data
|
||||
* The internal ConfigObject
|
||||
*
|
||||
* @var array
|
||||
* @var ConfigObject
|
||||
*/
|
||||
protected $data;
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* The INI file this configuration has been loaded from or should be written to
|
||||
* The INI file this config has been loaded from or should be written to
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
@ -54,19 +53,11 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
/**
|
||||
* Create a new config
|
||||
*
|
||||
* @param array $data The data to initialize the new config with
|
||||
* @param ConfigObject $config The config object to handle
|
||||
*/
|
||||
public function __construct(array $data = array())
|
||||
public function __construct(ConfigObject $config = null)
|
||||
{
|
||||
$this->data = array();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$this->data[$key] = new static($value);
|
||||
} else {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
}
|
||||
$this->config = $config !== null ? $config : new ConfigObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -82,7 +73,7 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
/**
|
||||
* Set this config's file path
|
||||
*
|
||||
* @param string $filepath The path to the config file
|
||||
* @param string $filepath The path to the ini file
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
|
@ -93,50 +84,33 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
}
|
||||
|
||||
/**
|
||||
* Deep clone this config
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->data as $key => $value) {
|
||||
if ($value instanceof self) {
|
||||
$array[$key] = clone $value;
|
||||
} else {
|
||||
$array[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$this->data = $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the count of available sections and properties
|
||||
* Return the count of available sections
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->data);
|
||||
return $this->config->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the current position of $this->data
|
||||
* Reset the current position of the internal config object
|
||||
*
|
||||
* @return mixed
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
return reset($this->data);
|
||||
return $this->config->rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the section's or property's value of the current iteration
|
||||
* Return the section of the current iteration
|
||||
*
|
||||
* @return mixed
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return current($this->data);
|
||||
return $this->config->current();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,165 +120,47 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
*/
|
||||
public function valid()
|
||||
{
|
||||
return key($this->data) !== null;
|
||||
return $this->config->valid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the section's or property's name of the current iteration
|
||||
* Return the section's name of the current iteration
|
||||
*
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
return key($this->data);
|
||||
return $this->config->key();
|
||||
}
|
||||
|
||||
/**
|
||||
* Advance the position of the current iteration and return the new section's or property's value
|
||||
* Advance the position of the current iteration and return the new section
|
||||
*
|
||||
* @return mixed
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
return next($this->data);
|
||||
return $this->config->next();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given section or property is set
|
||||
*
|
||||
* @param string $key The name of the section or property
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($key)
|
||||
{
|
||||
return isset($this->data[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the given property or the config for the given section
|
||||
*
|
||||
* @param string $key The name of the property or section
|
||||
*
|
||||
* @return mixed|NULL The value or NULL in case $key does not exist
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
if (array_key_exists($key, $this->data)) {
|
||||
return $this->data[$key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new property or section
|
||||
*
|
||||
* @param string $key The name of the new property or section
|
||||
* @param mixed $value The value to set for the new property or section
|
||||
*/
|
||||
public function __set($key, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
$this->data[$key] = new static($value);
|
||||
} else {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the given property or section
|
||||
*
|
||||
* @param string $key The property or section to remove
|
||||
*/
|
||||
public function __unset($key)
|
||||
{
|
||||
unset($this->data[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given section or property is set
|
||||
*
|
||||
* @param string $key The name of the section or property
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($key)
|
||||
{
|
||||
return isset($this->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the given property or the config for the given section
|
||||
*
|
||||
* @param string $key The name of the property or section
|
||||
*
|
||||
* @return mixed|NULL The value or NULL in case $key does not exist
|
||||
*/
|
||||
public function offsetGet($key)
|
||||
{
|
||||
return $this->$key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new property or section
|
||||
*
|
||||
* @param string $key The name of the new property or section
|
||||
* @param mixed $value The value to set for the new property or section
|
||||
*/
|
||||
public function offsetSet($key, $value)
|
||||
{
|
||||
if ($key === null) {
|
||||
throw new LogicException('Appending values without an explicit key is not supported');
|
||||
}
|
||||
|
||||
$this->$key = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the given property or section
|
||||
*
|
||||
* @param string $key The property or section to remove
|
||||
*/
|
||||
public function offsetUnset($key)
|
||||
{
|
||||
unset($this->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this config has any data
|
||||
* Return whether this config has any sections
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmpty()
|
||||
{
|
||||
return $this->count() === 0;
|
||||
return $this->config->isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the given property or the config for the given section
|
||||
*
|
||||
* @param string $key The name of the property or section
|
||||
* @param mixed $default The value to return in case the property or section is missing
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
$value = $this->$key;
|
||||
if ($default !== null && $value === null) {
|
||||
$value = $default;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all section and property names
|
||||
* Return this config's section names
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function keys()
|
||||
{
|
||||
return array_keys($this->data);
|
||||
return $this->config->keys();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -314,46 +170,7 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
*/
|
||||
public function toArray()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->data as $key => $value) {
|
||||
if ($value instanceof self) {
|
||||
$array[$key] = $value->toArray();
|
||||
} else {
|
||||
$array[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the given data with this config
|
||||
*
|
||||
* @param array|Config $data An array or a config
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function merge($data)
|
||||
{
|
||||
if ($data instanceof self) {
|
||||
$data = $data->toArray();
|
||||
}
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if (array_key_exists($key, $this->data)) {
|
||||
if (is_array($value)) {
|
||||
if ($this->data[$key] instanceof self) {
|
||||
$this->data[$key]->merge($value);
|
||||
} else {
|
||||
$this->data[$key] = new static($value);
|
||||
}
|
||||
} else {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
} else {
|
||||
$this->data[$key] = is_array($value) ? new static($value) : $value;
|
||||
}
|
||||
}
|
||||
return $this->config->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -367,14 +184,14 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
*
|
||||
* @throws UnexpectedValueException In case the given section does not hold any configuration
|
||||
*/
|
||||
public function fromSection($section, $key, $default = null)
|
||||
public function get($section, $key, $default = null)
|
||||
{
|
||||
$value = $this->$section;
|
||||
if ($value instanceof self) {
|
||||
$value = $this->config->$section;
|
||||
if ($value instanceof ConfigObject) {
|
||||
$value = $value->$key;
|
||||
} elseif ($value !== null) {
|
||||
throw new UnexpectedValueException(
|
||||
sprintf('Value "%s" is not of type "Config" or a sub-type of it', $value)
|
||||
sprintf('Value "%s" is not of type "%s" or a sub-type of it', $value, get_class($this->config))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -385,6 +202,78 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the given section
|
||||
*
|
||||
* @param string $name The section's name
|
||||
*
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function getSection($name)
|
||||
{
|
||||
$section = $this->config->get($name);
|
||||
return $section !== null ? $section : new ConfigObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set or replace a section
|
||||
*
|
||||
* @param string $name
|
||||
* @param array|ConfigObject $config
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setSection($name, $config = null)
|
||||
{
|
||||
if ($config === null) {
|
||||
$config = new ConfigObject();
|
||||
} elseif (! $config instanceof ConfigObject) {
|
||||
$config = new ConfigObject($config);
|
||||
}
|
||||
|
||||
$this->config->$name = $config;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a section
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function removeSection($name)
|
||||
{
|
||||
unset($this->config->$name);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given section exists
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasSection($name)
|
||||
{
|
||||
return isset($this->config->$name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a new config using the given array
|
||||
*
|
||||
* The returned config has no file associated to it.
|
||||
*
|
||||
* @param array $array The array to initialize the config with
|
||||
*
|
||||
* @return Config
|
||||
*/
|
||||
public static function fromArray(array $array)
|
||||
{
|
||||
return new static(new ConfigObject($array));
|
||||
}
|
||||
|
||||
/**
|
||||
* Load configuration from the given INI file
|
||||
*
|
||||
|
@ -394,19 +283,20 @@ class Config implements Countable, Iterator, ArrayAccess
|
|||
*/
|
||||
public static function fromIni($file)
|
||||
{
|
||||
$config = new static();
|
||||
$emptyConfig = new static();
|
||||
|
||||
$filepath = realpath($file);
|
||||
if ($filepath === false) {
|
||||
$config->setConfigFile($file);
|
||||
$emptyConfig->setConfigFile($file);
|
||||
} elseif (is_readable($filepath)) {
|
||||
$config = new static(new ConfigObject(parse_ini_file($filepath, true)));
|
||||
$config->setConfigFile($filepath);
|
||||
$config->merge(parse_ini_file($filepath, true));
|
||||
return $config;
|
||||
} else {
|
||||
throw new NotReadableError(t('Cannot read config file "%s". Permission denied'), $filepath);
|
||||
}
|
||||
|
||||
return $config;
|
||||
return $emptyConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
namespace Icinga\Application;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Application\Logger\Writer\FileWriter;
|
||||
use Icinga\Application\Logger\Writer\SyslogWriter;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
|
@ -71,12 +71,12 @@ class Logger
|
|||
/**
|
||||
* Create a new logger object
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*
|
||||
* @throws ConfigurationError If the logging configuration directive 'log' is missing or if the logging level is
|
||||
* not defined
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
if ($config->log === null) {
|
||||
throw new ConfigurationError('Required logging configuration directive \'log\' missing');
|
||||
|
@ -118,11 +118,11 @@ class Logger
|
|||
/**
|
||||
* Create a new logger object
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function create(Config $config)
|
||||
public static function create(ConfigObject $config)
|
||||
{
|
||||
static::$instance = new static($config);
|
||||
return static::$instance;
|
||||
|
@ -131,12 +131,12 @@ class Logger
|
|||
/**
|
||||
* Create a log writer
|
||||
*
|
||||
* @param Config $config The configuration to initialize the writer with
|
||||
* @param ConfigObject $config The configuration to initialize the writer with
|
||||
*
|
||||
* @return \Icinga\Application\Logger\LogWriter The requested log writer
|
||||
* @throws ConfigurationError If the requested writer cannot be found
|
||||
*/
|
||||
protected function createWriter(Config $config)
|
||||
protected function createWriter(ConfigObject $config)
|
||||
{
|
||||
$class = 'Icinga\\Application\\Logger\\Writer\\' . ucfirst(strtolower($config->log)) . 'Writer';
|
||||
if (! class_exists($class)) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Icinga\Application\Logger;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
|
||||
/**
|
||||
* Abstract class for writers that write messages to a log
|
||||
|
@ -12,14 +12,14 @@ use Icinga\Application\Config;
|
|||
abstract class LogWriter
|
||||
{
|
||||
/**
|
||||
* @var Zend_Config
|
||||
* @var ConfigObject
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new log writer initialized with the given configuration
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
namespace Icinga\Application\Logger\Writer;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Application\Logger\LogWriter;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
|
@ -26,12 +26,12 @@ class FileWriter extends LogWriter
|
|||
/**
|
||||
* Create a new file log writer
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*
|
||||
* @throws ConfigurationError If the configuration directive 'file' is missing or if the path to 'file' does
|
||||
* not exist or if writing to 'file' is not possible
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
if ($config->file === null) {
|
||||
throw new ConfigurationError('Required logging configuration directive \'file\' missing');
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Icinga\Application\Logger\Writer;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Application\Logger\LogWriter;
|
||||
|
||||
|
@ -51,9 +51,9 @@ class SyslogWriter extends LogWriter
|
|||
/**
|
||||
* Create a new syslog log writer
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
$this->ident = $config->get('application', 'icingaweb');
|
||||
$this->facility = static::$facilities['user'];
|
||||
|
|
|
@ -13,6 +13,7 @@ use Icinga\Exception\ConfigurationError;
|
|||
use Icinga\Exception\SystemPermissionException;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
use Icinga\Exception\NotReadableError;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
|
||||
/**
|
||||
* Module manager that handles detecting, enabling and disabling of modules
|
||||
|
@ -228,6 +229,7 @@ class Manager
|
|||
*
|
||||
* @return self
|
||||
* @throws ConfigurationError When trying to enable a module that is not installed
|
||||
* @throws NotFoundError In case the "enabledModules" directory does not exist
|
||||
* @throws SystemPermissionException When insufficient permissions for the application exist
|
||||
*/
|
||||
public function enableModule($name)
|
||||
|
@ -245,9 +247,11 @@ class Manager
|
|||
$target = $this->installedBaseDirs[$name];
|
||||
$link = $this->enableDir . '/' . $name;
|
||||
|
||||
if (!is_writable($this->enableDir)) {
|
||||
if (! is_dir($this->enableDir)) {
|
||||
throw new NotFoundError('Cannot enable module "%s". Path "%s" not found.', $name, $this->enableDir);
|
||||
} elseif (!is_writable($this->enableDir)) {
|
||||
throw new SystemPermissionException(
|
||||
'Can not enable module "%s". Insufficient system permissions for enabling modules.',
|
||||
'Cannot enable module "%s". Insufficient system permissions for enabling modules.',
|
||||
$name
|
||||
);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ use Icinga\Application\ApplicationBootstrap;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Util\Translator;
|
||||
use Icinga\Web\Hook;
|
||||
use Icinga\Web\Menu;
|
||||
|
@ -242,7 +243,7 @@ class Module
|
|||
if (array_key_exists($name, $this->menuItems)) {
|
||||
$this->menuItems[$name]->setProperties($properties);
|
||||
} else {
|
||||
$this->menuItems[$name] = new Menu($name, new Config($properties));
|
||||
$this->menuItems[$name] = new Menu($name, new ConfigObject($properties));
|
||||
}
|
||||
|
||||
return $this->menuItems[$name];
|
||||
|
|
|
@ -259,9 +259,7 @@ class Web extends ApplicationBootstrap
|
|||
$view->view->addHelperPath($this->getApplicationDir('/views/helpers'));
|
||||
|
||||
$view->view->setEncoding('UTF-8');
|
||||
$view->view->headTitle()->prepend(
|
||||
$this->config->global !== null ? $this->config->global->get('project', 'Icinga') : 'Icinga'
|
||||
);
|
||||
$view->view->headTitle()->prepend($this->config->get('global', 'project', 'Icinga'));
|
||||
|
||||
$view->view->headTitle()->setSeparator(' :: ');
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace Icinga\Authentication;
|
|||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Exception\NotReadableError;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\User;
|
||||
use Icinga\Util\String;
|
||||
|
||||
|
@ -15,13 +16,13 @@ use Icinga\Util\String;
|
|||
class AdmissionLoader
|
||||
{
|
||||
/**
|
||||
* @param string $username
|
||||
* @param array $userGroups
|
||||
* @param mixed $section
|
||||
* @param string $username
|
||||
* @param array $userGroups
|
||||
* @param ConfigObject $section
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function match($username, $userGroups, $section)
|
||||
protected function match($username, $userGroups, ConfigObject $section)
|
||||
{
|
||||
$username = strtolower($username);
|
||||
if (! empty($section->users)) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
namespace Icinga\Authentication;
|
||||
|
||||
use Iterator;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
|
@ -40,11 +41,13 @@ class AuthChain implements Iterator
|
|||
|
||||
/**
|
||||
* Rewind the chain
|
||||
*
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
$this->config->rewind();
|
||||
$this->currentBackend = null;
|
||||
return $this->config->rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,7 +63,7 @@ class AuthChain implements Iterator
|
|||
/**
|
||||
* Return the key of the current user backend config
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
|
@ -69,16 +72,18 @@ class AuthChain implements Iterator
|
|||
|
||||
/**
|
||||
* Move forward to the next user backend config
|
||||
*
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
$this->config->next();
|
||||
return $this->config->next();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current user backend is valid, i.e. it's enabled and the config's valid
|
||||
* Check if the current user backend is valid, i.e. it's enabled and the config is valid
|
||||
*
|
||||
* @return bool
|
||||
* @return bool
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
@ -86,13 +91,15 @@ class AuthChain implements Iterator
|
|||
// Stop when there are no more backends to check
|
||||
return false;
|
||||
}
|
||||
|
||||
$backendConfig = $this->config->current();
|
||||
if ((bool) $backendConfig->get('disabled', false) === true) {
|
||||
$this->next();
|
||||
return $this->valid();
|
||||
}
|
||||
|
||||
$name = $this->key();
|
||||
try {
|
||||
$name = $this->key();
|
||||
$backend = UserBackend::create($name, $backendConfig);
|
||||
} catch (ConfigurationError $e) {
|
||||
Logger::error(
|
||||
|
@ -105,6 +112,7 @@ class AuthChain implements Iterator
|
|||
$this->next();
|
||||
return $this->valid();
|
||||
}
|
||||
|
||||
$this->currentBackend = $backend;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
namespace Icinga\Authentication\Backend;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Authentication\UserBackend;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\User;
|
||||
|
||||
/**
|
||||
|
@ -23,9 +23,9 @@ class AutoLoginBackend extends UserBackend
|
|||
/**
|
||||
* Create new autologin backend
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
$this->stripUsernameRegexp = $config->get('strip_username_regexp');
|
||||
}
|
||||
|
|
|
@ -63,7 +63,8 @@ class Manager
|
|||
);
|
||||
$config = new Config();
|
||||
}
|
||||
if (($preferencesConfig = $config->preferences) !== null) {
|
||||
if ($config->hasSection('preferences')) {
|
||||
$preferencesConfig = $config->getSection('preferences');
|
||||
try {
|
||||
$preferencesStore = PreferencesStore::create(
|
||||
$preferencesConfig,
|
||||
|
|
|
@ -6,9 +6,9 @@ namespace Icinga\Authentication;
|
|||
|
||||
use Countable;
|
||||
use Icinga\Authentication\Backend\AutoLoginBackend;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Authentication\Backend\DbUserBackend;
|
||||
use Icinga\Authentication\Backend\LdapUserBackend;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\User;
|
||||
|
@ -45,7 +45,7 @@ abstract class UserBackend implements Countable
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
public static function create($name, Config $backendConfig)
|
||||
public static function create($name, ConfigObject $backendConfig)
|
||||
{
|
||||
if ($backendConfig->name !== null) {
|
||||
$name = $backendConfig->name;
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
namespace Icinga\Authentication;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Authentication\Backend\DbUserGroupBackend;
|
||||
use Icinga\Authentication\Backend\IniUserGroupBackend;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\IcingaException;
|
||||
|
@ -50,13 +50,13 @@ abstract class UserGroupBackend
|
|||
/**
|
||||
* Create a user group backend
|
||||
*
|
||||
* @param string $name
|
||||
* @param Config $backendConfig
|
||||
* @param string $name
|
||||
* @param ConfigObject $backendConfig
|
||||
*
|
||||
* @return DbUserGroupBackend|IniUserGroupBackend
|
||||
* @throws ConfigurationError If the backend configuration is invalid
|
||||
*/
|
||||
public static function create($name, Config $backendConfig)
|
||||
public static function create($name, ConfigObject $backendConfig)
|
||||
{
|
||||
if ($backendConfig->name !== null) {
|
||||
$name = $backendConfig->name;
|
||||
|
|
|
@ -0,0 +1,304 @@
|
|||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Data;
|
||||
|
||||
use Iterator;
|
||||
use Countable;
|
||||
use ArrayAccess;
|
||||
use LogicException;
|
||||
|
||||
/**
|
||||
* Container for configuration values
|
||||
*/
|
||||
class ConfigObject implements Countable, Iterator, ArrayAccess
|
||||
{
|
||||
/**
|
||||
* This config's data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $data;
|
||||
|
||||
/**
|
||||
* Create a new config
|
||||
*
|
||||
* @param array $data The data to initialize the new config with
|
||||
*/
|
||||
public function __construct(array $data = array())
|
||||
{
|
||||
$this->data = array();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$this->data[$key] = new static($value);
|
||||
} else {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deep clone this config
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->data as $key => $value) {
|
||||
if ($value instanceof self) {
|
||||
$array[$key] = clone $value;
|
||||
} else {
|
||||
$array[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$this->data = $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the count of available sections and properties
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the current position of $this->data
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
return reset($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the section's or property's value of the current iteration
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return current($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the position of the current iteration is valid
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return key($this->data) !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the section's or property's name of the current iteration
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
return key($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Advance the position of the current iteration and return the new section's or property's value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
return next($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given section or property is set
|
||||
*
|
||||
* @param string $key The name of the section or property
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($key)
|
||||
{
|
||||
return isset($this->data[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the given property or the config for the given section
|
||||
*
|
||||
* @param string $key The name of the property or section
|
||||
*
|
||||
* @return mixed|NULL The value or NULL in case $key does not exist
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
return $this->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new property or section
|
||||
*
|
||||
* @param string $key The name of the new property or section
|
||||
* @param mixed $value The value to set for the new property or section
|
||||
*/
|
||||
public function __set($key, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
$this->data[$key] = new static($value);
|
||||
} else {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the given property or section
|
||||
*
|
||||
* @param string $key The property or section to remove
|
||||
*/
|
||||
public function __unset($key)
|
||||
{
|
||||
unset($this->data[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given section or property is set
|
||||
*
|
||||
* @param string $key The name of the section or property
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($key)
|
||||
{
|
||||
return isset($this->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the given property or the config for the given section
|
||||
*
|
||||
* @param string $key The name of the property or section
|
||||
*
|
||||
* @return mixed|NULL The value or NULL in case $key does not exist
|
||||
*/
|
||||
public function offsetGet($key)
|
||||
{
|
||||
return $this->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new property or section
|
||||
*
|
||||
* @param string $key The name of the new property or section
|
||||
* @param mixed $value The value to set for the new property or section
|
||||
*/
|
||||
public function offsetSet($key, $value)
|
||||
{
|
||||
if ($key === null) {
|
||||
throw new LogicException('Appending values without an explicit key is not supported');
|
||||
}
|
||||
|
||||
$this->$key = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the given property or section
|
||||
*
|
||||
* @param string $key The property or section to remove
|
||||
*/
|
||||
public function offsetUnset($key)
|
||||
{
|
||||
unset($this->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this config has any data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmpty()
|
||||
{
|
||||
return empty($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the given property or the config for the given section
|
||||
*
|
||||
* @param string $key The name of the property or section
|
||||
* @param mixed $default The value to return in case the property or section is missing
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if (array_key_exists($key, $this->data)) {
|
||||
return $this->data[$key];
|
||||
}
|
||||
|
||||
return $default !== null ? $default : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all section and property names
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function keys()
|
||||
{
|
||||
return array_keys($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return this config's data as associative array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->data as $key => $value) {
|
||||
if ($value instanceof self) {
|
||||
$array[$key] = $value->toArray();
|
||||
} else {
|
||||
$array[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the given data with this config
|
||||
*
|
||||
* @param array|Config $data An array or a config
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function merge($data)
|
||||
{
|
||||
if ($data instanceof self) {
|
||||
$data = $data->toArray();
|
||||
}
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if (array_key_exists($key, $this->data)) {
|
||||
if (is_array($value)) {
|
||||
if ($this->data[$key] instanceof self) {
|
||||
$this->data[$key]->merge($value);
|
||||
} else {
|
||||
$this->data[$key] = new static($value);
|
||||
}
|
||||
} else {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
} else {
|
||||
$this->data[$key] = is_array($value) ? new static($value) : $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
|
@ -6,8 +6,8 @@ namespace Icinga\Data\Db;
|
|||
|
||||
use PDO;
|
||||
use Zend_Db;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Benchmark;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\Db\DbQuery;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Data\Selectable;
|
||||
|
@ -21,7 +21,7 @@ class DbConnection implements Selectable
|
|||
/**
|
||||
* Connection config
|
||||
*
|
||||
* @var Config
|
||||
* @var ConfigObject
|
||||
*/
|
||||
private $config;
|
||||
|
||||
|
@ -59,9 +59,9 @@ class DbConnection implements Selectable
|
|||
/**
|
||||
* Create a new connection object
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*/
|
||||
public function __construct(Config $config = null)
|
||||
public function __construct(ConfigObject $config = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
if (isset($config->prefix)) {
|
||||
|
|
|
@ -40,14 +40,15 @@ class ResourceFactory implements ConfigAwareFactory
|
|||
*
|
||||
* @param $resourceName String The resource's name
|
||||
*
|
||||
* @return Config The configuration of the resource
|
||||
* @return ConfigObject The configuration of the resource
|
||||
*
|
||||
* @throws ConfigurationError
|
||||
*/
|
||||
public static function getResourceConfig($resourceName)
|
||||
{
|
||||
self::assertResourcesExist();
|
||||
if (($resourceConfig = self::$resources->get($resourceName)) === null) {
|
||||
$resourceConfig = self::$resources->getSection($resourceName);
|
||||
if ($resourceConfig->isEmpty()) {
|
||||
throw new ConfigurationError(
|
||||
'Cannot load resource config "%s". Resource does not exist',
|
||||
$resourceName
|
||||
|
@ -59,24 +60,12 @@ class ResourceFactory implements ConfigAwareFactory
|
|||
/**
|
||||
* Return the configuration of all existing resources, or get all resources of a given type.
|
||||
*
|
||||
* @param String|null $type Fetch only resources that have the given type.
|
||||
*
|
||||
* @return Config The configuration containing all resources
|
||||
*/
|
||||
public static function getResourceConfigs($type = null)
|
||||
public static function getResourceConfigs()
|
||||
{
|
||||
self::assertResourcesExist();
|
||||
if (!isset($type)) {
|
||||
return self::$resources;
|
||||
} else {
|
||||
$resources = array();
|
||||
foreach (self::$resources as $name => $resource) {
|
||||
if (strtolower($resource->type) === $type) {
|
||||
$resources[$name] = $resource;
|
||||
}
|
||||
}
|
||||
return new Config($resources);
|
||||
}
|
||||
return self::$resources;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,13 +88,13 @@ class ResourceFactory implements ConfigAwareFactory
|
|||
* NOTE: The factory does not test if the given configuration is valid and the resource is accessible, this
|
||||
* depends entirely on the implementation of the returned resource.
|
||||
*
|
||||
* @param Config $config The configuration for the created resource.
|
||||
* @param ConfigObject $config The configuration for the created resource.
|
||||
*
|
||||
* @return DbConnection|LdapConnection|LivestatusConnection An object that can be used to access
|
||||
* the given resource. The returned class depends on the configuration property 'type'.
|
||||
* @throws ConfigurationError When an unsupported type is given
|
||||
*/
|
||||
public static function createResource(Config $config)
|
||||
public static function createResource(ConfigObject $config)
|
||||
{
|
||||
switch (strtolower($config->type)) {
|
||||
case 'db':
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Exception;
|
||||
|
||||
class NotFoundError extends IcingaException
|
||||
{
|
||||
}
|
|
@ -5,8 +5,8 @@
|
|||
namespace Icinga\Protocol\File;
|
||||
|
||||
use Countable;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\Selectable;
|
||||
use Icinga\Data\ConfigObject;
|
||||
|
||||
/**
|
||||
* Read file line by line
|
||||
|
@ -30,11 +30,11 @@ class FileReader implements Selectable, Countable
|
|||
/**
|
||||
* Create a new reader
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*
|
||||
* @throws FileReaderException If a required $config directive (filename or fields) is missing
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
foreach (array('filename', 'fields') as $key) {
|
||||
if (isset($config->{$key})) {
|
||||
|
|
|
@ -8,6 +8,7 @@ use Icinga\Protocol\Ldap\Exception as LdapException;
|
|||
use Icinga\Application\Platform;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Data\ConfigObject;
|
||||
|
||||
/**
|
||||
* Backend class managing all the LDAP stuff for you.
|
||||
|
@ -101,9 +102,9 @@ class Connection
|
|||
*
|
||||
* TODO: Allow to pass port and SSL options
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*/
|
||||
public function __construct(Config $config)
|
||||
public function __construct(ConfigObject $config)
|
||||
{
|
||||
$this->hostname = $config->hostname;
|
||||
$this->bind_dn = $config->bind_dn;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Icinga\Protocol\Ldap;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Protocol\Dns;
|
||||
|
||||
class Discovery {
|
||||
|
@ -149,7 +149,7 @@ class Discovery {
|
|||
*/
|
||||
public static function discover($host, $port)
|
||||
{
|
||||
$conn = new Connection(new Config(array(
|
||||
$conn = new Connection(new ConfigObject(array(
|
||||
'hostname' => $host,
|
||||
'port' => $port
|
||||
)));
|
||||
|
|
|
@ -26,8 +26,8 @@ namespace Icinga\Test {
|
|||
use Mockery;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Util\DateTimeFactory;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Data\Db\DbConnection;
|
||||
|
||||
|
@ -158,11 +158,17 @@ namespace Icinga\Test {
|
|||
->andReturnUsing(function ($name, $default) { return $default; })->byDefault();
|
||||
|
||||
$responseMock = Mockery::mock('Icinga\Web\Response')->shouldDeferMissing();
|
||||
|
||||
// Can't express this as demeter chains. See: https://github.com/padraic/mockery/issues/59
|
||||
$bootstrapMock = Mockery::mock('Icinga\Application\ApplicationBootstrap')->shouldDeferMissing();
|
||||
$libDir = dirname(self::$libDir);
|
||||
$bootstrapMock->shouldReceive('getFrontController')->andReturn($bootstrapMock)
|
||||
->shouldReceive('getApplicationDir')->andReturn(self::$appDir)
|
||||
->shouldReceive('getLibraryDir')->andReturnUsing(function ($subdir = null) use ($libDir) {
|
||||
if ($subdir !== null) {
|
||||
$libDir .= '/' . ltrim($subdir, '/');
|
||||
}
|
||||
return $libDir;
|
||||
})
|
||||
->shouldReceive('getRequest')->andReturn($requestMock)
|
||||
->shouldReceive('getResponse')->andReturn($responseMock);
|
||||
|
||||
|
@ -195,13 +201,13 @@ namespace Icinga\Test {
|
|||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Config
|
||||
* @return ConfigObject
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function createDbConfigFor($name)
|
||||
{
|
||||
if (array_key_exists($name, self::$dbConfiguration)) {
|
||||
return new Config(self::$dbConfiguration[$name]);
|
||||
return new ConfigObject(self::$dbConfiguration[$name]);
|
||||
}
|
||||
|
||||
throw new RuntimeException('Configuration for database type not available: ' . $name);
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Icinga\User\Preferences;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\User;
|
||||
use Icinga\User\Preferences;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Data\Db\DbConnection;
|
||||
|
@ -18,14 +19,14 @@ use Icinga\Data\Db\DbConnection;
|
|||
* <code>
|
||||
* <?php
|
||||
*
|
||||
* use Icinga\Application\Config;
|
||||
* use Icinga\Data\ConfigObject;
|
||||
* use Icinga\User\Preferences;
|
||||
* use Icinga\User\Preferences\PreferencesStore;
|
||||
*
|
||||
* // Create a INI store
|
||||
* $store = PreferencesStore::create(
|
||||
* new Config(
|
||||
* 'type' => 'ini',
|
||||
* new ConfigObject(
|
||||
* 'type' => 'ini',
|
||||
* 'config_path' => '/path/to/preferences'
|
||||
* ),
|
||||
* $user // Instance of \Icinga\User
|
||||
|
@ -41,7 +42,7 @@ abstract class PreferencesStore
|
|||
/**
|
||||
* Store config
|
||||
*
|
||||
* @var Config
|
||||
* @var ConfigObject
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
|
@ -55,10 +56,10 @@ abstract class PreferencesStore
|
|||
/**
|
||||
* Create a new store
|
||||
*
|
||||
* @param Config $config The config for this adapter
|
||||
* @param User $user The user to which these preferences belong
|
||||
* @param ConfigObject $config The config for this adapter
|
||||
* @param User $user The user to which these preferences belong
|
||||
*/
|
||||
public function __construct(Config $config, User $user)
|
||||
public function __construct(ConfigObject $config, User $user)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->user = $user;
|
||||
|
@ -68,7 +69,7 @@ abstract class PreferencesStore
|
|||
/**
|
||||
* Getter for the store config
|
||||
*
|
||||
* @return Config
|
||||
* @return ConfigObject
|
||||
*/
|
||||
public function getStoreConfig()
|
||||
{
|
||||
|
@ -107,14 +108,14 @@ abstract class PreferencesStore
|
|||
/**
|
||||
* Create preferences storage adapter from config
|
||||
*
|
||||
* @param Config $config The config for the adapter
|
||||
* @param User $user The user to which these preferences belong
|
||||
* @param ConfigObject $config The config for the adapter
|
||||
* @param User $user The user to which these preferences belong
|
||||
*
|
||||
* @return self
|
||||
*
|
||||
* @throws ConfigurationError When the configuration defines an invalid storage type
|
||||
*/
|
||||
public static function create(Config $config, User $user)
|
||||
public static function create(ConfigObject $config, User $user)
|
||||
{
|
||||
if (($type = $config->type) === null) {
|
||||
throw new ConfigurationError(
|
||||
|
|
|
@ -120,7 +120,7 @@ class IniStore extends PreferencesStore
|
|||
|
||||
$this->writer = new IniWriter(
|
||||
array(
|
||||
'config' => new Config($this->preferences),
|
||||
'config' => Config::fromArray($this->preferences),
|
||||
'filename' => $this->preferencesFile
|
||||
)
|
||||
);
|
||||
|
|
|
@ -36,6 +36,13 @@ class Form extends Zend_Form
|
|||
*/
|
||||
protected $created = false;
|
||||
|
||||
/**
|
||||
* The request associated with this form
|
||||
*
|
||||
* @var Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* The callback to call instead of Form::onSuccess()
|
||||
*
|
||||
|
@ -94,37 +101,66 @@ class Form extends Zend_Form
|
|||
*/
|
||||
protected $uidElementName = 'formUID';
|
||||
|
||||
/**
|
||||
* Whether the form should validate the sent data when being automatically submitted
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $validatePartial = false;
|
||||
|
||||
/**
|
||||
* Default element decorators
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $defaultElementDecorators = array(
|
||||
'ViewHelper',
|
||||
'Errors',
|
||||
array('Description', array('tag' => 'span', 'class' => 'description')),
|
||||
'Label',
|
||||
array('HtmlTag', array('tag' => 'div'))
|
||||
array('ViewHelper', array('separator' => '')),
|
||||
array('Errors', array('separator' => '')),
|
||||
array('Help'),
|
||||
array('Label', array('separator' => '')),
|
||||
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
|
||||
);
|
||||
|
||||
/**
|
||||
* Set a callback that is called instead of this form's onSuccess method
|
||||
* Create a new form
|
||||
*
|
||||
* It is called using the following signature: (Request $request, Form $form).
|
||||
* Accepts an additional option `onSuccess' which is a callback that is called instead of this
|
||||
* form's method. It is called using the following signature: (Form $form).
|
||||
*
|
||||
* @param callable $onSuccess Callback
|
||||
* @see Zend_Form::__construct()
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws LogicException If the callback is not callable
|
||||
* @throws LogicException In case `onSuccess' is not callable
|
||||
*/
|
||||
public function setOnSuccess($onSuccess)
|
||||
public function __construct($options = null)
|
||||
{
|
||||
if (! is_callable($onSuccess)) {
|
||||
if (is_array($options) && isset($options['onSuccess'])) {
|
||||
$this->onSuccess = $options['onSuccess'];
|
||||
unset($options['onSuccess']);
|
||||
} elseif (isset($options->onSuccess)) {
|
||||
$this->onSuccess = $options->onSuccess;
|
||||
unset($options->onSuccess);
|
||||
}
|
||||
|
||||
if ($this->onSuccess !== null && false === is_callable($this->onSuccess)) {
|
||||
throw new LogicException('The option `onSuccess\' is not callable');
|
||||
}
|
||||
$this->onSuccess = $onSuccess;
|
||||
return $this;
|
||||
|
||||
// Zend's plugin loader reverses the order of added prefix paths thus trying our paths first before trying
|
||||
// Zend paths
|
||||
$this->addPrefixPaths(array(
|
||||
array(
|
||||
'prefix' => 'Icinga\\Web\\Form\\Element\\',
|
||||
'path' => Icinga::app()->getLibraryDir('Icinga/Web/Form/Element'),
|
||||
'type' => static::ELEMENT
|
||||
),
|
||||
array(
|
||||
'prefix' => 'Icinga\\Web\\Form\\Decorator\\',
|
||||
'path' => Icinga::app()->getLibraryDir('Icinga/Web/Form/Decorator'),
|
||||
'type' => static::DECORATOR
|
||||
)
|
||||
));
|
||||
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -304,6 +340,29 @@ class Form extends Zend_Form
|
|||
return $this->uidElementName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether this form should validate the sent data when being automatically submitted
|
||||
*
|
||||
* @param bool $state
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setValidatePartial($state)
|
||||
{
|
||||
$this->validatePartial = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this form should validate the sent data when being automatically submitted
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getValidatePartial()
|
||||
{
|
||||
return $this->validatePartial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create this form
|
||||
*
|
||||
|
@ -348,11 +407,9 @@ class Form extends Zend_Form
|
|||
*
|
||||
* Intended to be implemented by concrete form classes. The base implementation returns always FALSE.
|
||||
*
|
||||
* @param Request $request The valid request used to process this form
|
||||
*
|
||||
* @return null|bool Return FALSE in case no redirect should take place
|
||||
*/
|
||||
public function onSuccess(Request $request)
|
||||
public function onSuccess()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -361,10 +418,8 @@ class Form extends Zend_Form
|
|||
* Perform actions when no form dependent data was sent
|
||||
*
|
||||
* Intended to be implemented by concrete form classes.
|
||||
*
|
||||
* @param Request $request The current request
|
||||
*/
|
||||
public function onRequest(Request $request)
|
||||
public function onRequest()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -430,8 +485,8 @@ class Form extends Zend_Form
|
|||
* `disableLoadDefaultDecorators' option to any other value than `true'. For loading custom element decorators use
|
||||
* the 'decorators' option.
|
||||
*
|
||||
* @param string $type String element type
|
||||
* @param string $name The name of the element to add
|
||||
* @param string $type The type of the element
|
||||
* @param string $name The name of the element
|
||||
* @param mixed $options The options for the element
|
||||
*
|
||||
* @return Zend_Form_Element
|
||||
|
@ -456,7 +511,15 @@ class Form extends Zend_Form
|
|||
$el = parent::createElement($type, $name, $options);
|
||||
|
||||
if ($el && $el->getAttrib('autosubmit')) {
|
||||
$el->addDecorator(new NoScriptApply()); // Non-JS environments
|
||||
$noScript = new NoScriptApply(); // Non-JS environments
|
||||
$decorators = $el->getDecorators();
|
||||
$pos = array_search('Zend_Form_Decorator_ViewHelper', array_keys($decorators)) + 1;
|
||||
$el->setDecorators(
|
||||
array_slice($decorators, 0, $pos, true)
|
||||
+ array(get_class($noScript) => $noScript)
|
||||
+ array_slice($decorators, $pos, count($decorators) - $pos, true)
|
||||
);
|
||||
|
||||
$class = $el->getAttrib('class');
|
||||
if (is_array($class)) {
|
||||
$class[] = 'autosubmit';
|
||||
|
@ -466,6 +529,7 @@ class Form extends Zend_Form
|
|||
$class .= ' autosubmit';
|
||||
}
|
||||
$el->setAttrib('class', $class); // JS environments
|
||||
|
||||
unset($el->autosubmit);
|
||||
}
|
||||
|
||||
|
@ -533,23 +597,25 @@ class Form extends Zend_Form
|
|||
{
|
||||
if ($request === null) {
|
||||
$request = $this->getRequest();
|
||||
} else {
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
$formData = $this->getRequestData($request);
|
||||
$formData = $this->getRequestData();
|
||||
if ($this->getUidDisabled() || $this->wasSent($formData)) {
|
||||
$this->populate($formData); // Necessary to get isSubmitted() to work
|
||||
if (! $this->getSubmitLabel() || $this->isSubmitted()) {
|
||||
if ($this->isValid($formData)
|
||||
&& (($this->onSuccess !== null && false !== call_user_func($this->onSuccess, $request, $this))
|
||||
|| ($this->onSuccess === null && false !== $this->onSuccess($request)))) {
|
||||
&& (($this->onSuccess !== null && false !== call_user_func($this->onSuccess, $this))
|
||||
|| ($this->onSuccess === null && false !== $this->onSuccess()))) {
|
||||
$this->getResponse()->redirectAndExit($this->getRedirectUrl());
|
||||
}
|
||||
} else {
|
||||
// The form can't be processed but we want to show validation errors though
|
||||
} elseif ($this->getValidatePartial()) {
|
||||
// The form can't be processed but we may want to show validation errors though
|
||||
$this->isValidPartial($formData);
|
||||
}
|
||||
} else {
|
||||
$this->onRequest($request);
|
||||
$this->onRequest();
|
||||
}
|
||||
|
||||
return $request;
|
||||
|
@ -599,6 +665,14 @@ class Form extends Zend_Form
|
|||
public function isValidPartial(array $formData)
|
||||
{
|
||||
$this->create($formData);
|
||||
|
||||
// Ensure that disabled elements are not overwritten (http://www.zendframework.com/issues/browse/ZF-6909)
|
||||
foreach ($this->getElements() as $name => $element) {
|
||||
if ($element->getAttrib('disabled')) {
|
||||
$formData[$name] = $element->getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return parent::isValidPartial($formData);
|
||||
}
|
||||
|
||||
|
@ -612,6 +686,14 @@ class Form extends Zend_Form
|
|||
public function isValid($formData)
|
||||
{
|
||||
$this->create($formData);
|
||||
|
||||
// Ensure that disabled elements are not overwritten (http://www.zendframework.com/issues/browse/ZF-6909)
|
||||
foreach ($this->getElements() as $name => $element) {
|
||||
if ($element->getAttrib('disabled')) {
|
||||
$formData[$name] = $element->getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return parent::isValid($formData);
|
||||
}
|
||||
|
||||
|
@ -675,29 +757,19 @@ class Form extends Zend_Form
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the request data based on this form's request method
|
||||
* Return the request associated with this form
|
||||
*
|
||||
* @param Request $request The request to fetch the data from
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRequestData(Request $request)
|
||||
{
|
||||
if (strtolower($request->getMethod()) === $this->getMethod()) {
|
||||
return $request->{'get' . ($request->isPost() ? 'Post' : 'Query')}();
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current request
|
||||
* Returns the global request if none has been set for this form yet.
|
||||
*
|
||||
* @return Request
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
return Icinga::app()->getFrontController()->getRequest();
|
||||
if ($this->request === null) {
|
||||
$this->request = Icinga::app()->getFrontController()->getRequest();
|
||||
}
|
||||
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -710,6 +782,20 @@ class Form extends Zend_Form
|
|||
return Icinga::app()->getFrontController()->getResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the request data based on this form's request method
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getRequestData()
|
||||
{
|
||||
if (strtolower($this->request->getMethod()) === $this->getMethod()) {
|
||||
return $this->request->{'get' . ($this->request->isPost() ? 'Post' : 'Query')}();
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render this form
|
||||
*
|
||||
|
@ -723,4 +809,3 @@ class Form extends Zend_Form
|
|||
return parent::render($view);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Web\Form\Decorator;
|
||||
|
||||
use Icinga\Application\Icinga;
|
||||
use Zend_Form_Decorator_Abstract;
|
||||
|
||||
/**
|
||||
* A decorator that will display the description as a help icon
|
||||
*/
|
||||
class Help extends Zend_Form_Decorator_Abstract
|
||||
{
|
||||
/**
|
||||
* Render a description and show it as a help icon
|
||||
*
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
public function render($content = '')
|
||||
{
|
||||
$element = $this->getElement();
|
||||
$description = $element->getView()->escape($element->getDescription());
|
||||
|
||||
if (! empty($description)) {
|
||||
$helpIcon = Icinga::app()->getViewRenderer()->view->icon('help', $description);
|
||||
return $helpIcon . $content;
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ use RecursiveIterator;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
use Icinga\Web\Url;
|
||||
|
@ -79,10 +80,10 @@ class Menu implements RecursiveIterator
|
|||
/**
|
||||
* Create a new menu
|
||||
*
|
||||
* @param int $id The id of this menu
|
||||
* @param Config $config The configuration for this menu
|
||||
* @param int $id The id of this menu
|
||||
* @param ConfigObject $config The configuration for this menu
|
||||
*/
|
||||
public function __construct($id, Config $config = null, Menu $parent = null)
|
||||
public function __construct($id, ConfigObject $config = null, Menu $parent = null)
|
||||
{
|
||||
$this->id = $id;
|
||||
if ($parent !== null) {
|
||||
|
@ -94,7 +95,7 @@ class Menu implements RecursiveIterator
|
|||
/**
|
||||
* Set all given properties
|
||||
*
|
||||
* @param array|Config $props Property list
|
||||
* @param array|ConfigObject $props Property list
|
||||
*/
|
||||
public function setProperties($props = null)
|
||||
{
|
||||
|
@ -170,7 +171,7 @@ class Menu implements RecursiveIterator
|
|||
|
||||
foreach ($modules as $moduleName) {
|
||||
$moduleMenuConfig = Config::module($moduleName, 'menu');
|
||||
if (false === empty($moduleMenuConfig)) {
|
||||
if (! $moduleMenuConfig->isEmpty()) {
|
||||
$menuConfigs[] = $moduleMenuConfig;
|
||||
}
|
||||
}
|
||||
|
@ -424,11 +425,11 @@ class Menu implements RecursiveIterator
|
|||
* Add a sub menu to this menu
|
||||
*
|
||||
* @param string $id The id of the menu to add
|
||||
* @param Config $itemConfig The config with which to initialize the menu
|
||||
* @param ConfigObject $itemConfig The config with which to initialize the menu
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function addSubMenu($id, Config $menuConfig = null)
|
||||
public function addSubMenu($id, ConfigObject $menuConfig = null)
|
||||
{
|
||||
if (false === ($pos = strpos($id, '.'))) {
|
||||
$subMenu = new self($id, $menuConfig, $this);
|
||||
|
@ -518,7 +519,7 @@ class Menu implements RecursiveIterator
|
|||
*/
|
||||
public function add($name, $config = array())
|
||||
{
|
||||
return $this->addSubMenu($name, new Config($config));
|
||||
return $this->addSubMenu($name, new ConfigObject($config));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
namespace Icinga\Web\Widget\Dashboard;
|
||||
|
||||
use Zend_Form_Element_Button;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Url;
|
||||
use Icinga\Web\Widget\AbstractWidget;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Exception\IcingaException;
|
||||
|
||||
/**
|
||||
|
@ -222,13 +222,13 @@ EOD;
|
|||
/**
|
||||
* Create a @see Component instance from the given Zend config, using the provided title
|
||||
*
|
||||
* @param $title The title for this component
|
||||
* @param Config $config The configuration defining url, parameters, height, width, etc.
|
||||
* @param Pane $pane The pane this component belongs to
|
||||
* @param $title The title for this component
|
||||
* @param ConfigObject $config The configuration defining url, parameters, height, width, etc.
|
||||
* @param Pane $pane The pane this component belongs to
|
||||
*
|
||||
* @return Component A newly created Component for use in the Dashboard
|
||||
*/
|
||||
public static function fromIni($title, Config $config, Pane $pane)
|
||||
public static function fromIni($title, ConfigObject $config, Pane $pane)
|
||||
{
|
||||
$height = null;
|
||||
$width = null;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Icinga\Web\Widget\Dashboard;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Web\Widget\AbstractWidget;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
|
@ -275,11 +275,11 @@ class Pane extends UserWidget
|
|||
* Create a new pane with the title $title from the given configuration
|
||||
*
|
||||
* @param $title The title for this pane
|
||||
* @param Config $config The configuration to use for setup
|
||||
* @param ConfigObject $config The configuration to use for setup
|
||||
*
|
||||
* @return Pane
|
||||
*/
|
||||
public static function fromIni($title, Config $config)
|
||||
public static function fromIni($title, ConfigObject $config)
|
||||
{
|
||||
$pane = new Pane($title);
|
||||
if ($config->get('title', false)) {
|
||||
|
|
|
@ -60,8 +60,8 @@ class Monitoring_ConfigController extends ModuleActionController
|
|||
{
|
||||
$config = $this->Config('backends');
|
||||
$form = new ConfirmRemovalForm(array(
|
||||
'onSuccess' => function ($request) use ($config) {
|
||||
$backendName = $request->getQuery('backend');
|
||||
'onSuccess' => function ($form) use ($config) {
|
||||
$backendName = $form->getRequest()->getQuery('backend');
|
||||
$configForm = new BackendConfigForm();
|
||||
$configForm->setIniConfig($config);
|
||||
|
||||
|
@ -92,8 +92,8 @@ class Monitoring_ConfigController extends ModuleActionController
|
|||
{
|
||||
$config = $this->Config('instances');
|
||||
$form = new ConfirmRemovalForm(array(
|
||||
'onSuccess' => function ($request) use ($config) {
|
||||
$instanceName = $request->getQuery('instance');
|
||||
'onSuccess' => function ($form) use ($config) {
|
||||
$instanceName = $form->getRequest()->getQuery('instance');
|
||||
$configForm = new InstanceConfigForm();
|
||||
$configForm->setIniConfig($config);
|
||||
|
||||
|
|
|
@ -44,6 +44,16 @@ abstract class CommandForm extends Form
|
|||
return $this->backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command help description
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the transport used to send commands
|
||||
*
|
||||
|
|
|
@ -24,22 +24,24 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
|||
$this->setSubmitLabel(mt('monitoring', 'Disable Notifications'));
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return mt(
|
||||
'monitoring',
|
||||
'This command is used to disable host and service notifications for a specific time.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Web\Form::createElements() For the method documentation.
|
||||
*/
|
||||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElement(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to disable host and service notifications for a specific time.'
|
||||
)
|
||||
)
|
||||
);
|
||||
$expireTime = new DateTime();
|
||||
$expireTime->add(new DateInterval('PT1H'));
|
||||
$this->addElement(
|
||||
|
|
|
@ -25,6 +25,20 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return mt(
|
||||
'monitoring',
|
||||
'This command is used to acknowledge host or service problems. When a problem is acknowledged,'
|
||||
. ' future notifications about problems are temporarily disabled until the host or service'
|
||||
. ' recovers.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Web\Form::createElements() For the method documentation.
|
||||
|
@ -32,18 +46,6 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to acknowledge host or service problems. When a problem is acknowledged,'
|
||||
. ' future notifications about problems are temporarily disabled until the host or service'
|
||||
. ' recovers.'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'textarea',
|
||||
'comment',
|
||||
|
|
|
@ -23,6 +23,18 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return mt(
|
||||
'monitoring',
|
||||
'This command is used to add host or service comments.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Web\Form::createElements() For the method documentation.
|
||||
|
@ -30,16 +42,6 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to add host or service comments.'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'textarea',
|
||||
'comment',
|
||||
|
|
|
@ -26,6 +26,19 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return mt(
|
||||
'monitoring',
|
||||
'This command is used to schedule the next check of hosts or services. Icinga will re-queue the'
|
||||
. ' hosts or services to be checked at the time you specify.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Web\Form::createElements() For the method documentation.
|
||||
|
|
|
@ -36,6 +36,22 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return mt(
|
||||
'monitoring',
|
||||
'This command is used to schedule host and service downtimes. During the specified downtime,'
|
||||
. ' Icinga will not send notifications out about the hosts and services. When the scheduled'
|
||||
. ' downtime expires, Icinga will send out notifications for the hosts and services as it'
|
||||
. ' normally would. Scheduled downtimes are preserved across program shutdowns and'
|
||||
. ' restarts.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPDoc)
|
||||
* @see \Icinga\Web\Form::createElements() For the method documentation.
|
||||
|
@ -46,20 +62,6 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
$end = clone $start;
|
||||
$end->add(new DateInterval('PT1H'));
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to schedule host and service downtimes. During the specified downtime,'
|
||||
. ' Icinga will not send notifications out about the hosts and services. When the scheduled'
|
||||
. ' downtime expires, Icinga will send out notifications for the hosts and services as it'
|
||||
. ' normally would. Scheduled downtimes are preserved across program shutdowns and'
|
||||
. ' restarts.'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'textarea',
|
||||
'comment',
|
||||
|
|
|
@ -73,12 +73,12 @@ class BackendConfigForm extends ConfigForm
|
|||
$name = isset($values['name']) ? $values['name'] : '';
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Monitoring backend name missing'));
|
||||
} elseif ($this->config->get($name) !== null) {
|
||||
} elseif ($this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Monitoring backend already exists'));
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
$this->config->{$name} = $values;
|
||||
$this->config->setSection($name, $values);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -98,14 +98,13 @@ class BackendConfigForm extends ConfigForm
|
|||
throw new InvalidArgumentException(mt('monitoring', 'Old monitoring backend name missing'));
|
||||
} elseif (! ($newName = isset($values['name']) ? $values['name'] : '')) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'New monitoring backend name missing'));
|
||||
} elseif (($backendConfig = $this->config->get($name)) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Unknown monitoring backend provided'));
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
unset($this->config->{$name});
|
||||
$this->config->{$newName} = $values;
|
||||
return $this->config->{$newName};
|
||||
$this->config->setSection($name, $values);
|
||||
return $this->config->getSection($name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,11 +120,12 @@ class BackendConfigForm extends ConfigForm
|
|||
{
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Monitoring backend name missing'));
|
||||
} elseif (($backendConfig = $this->config->get($name)) === null) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Unknown monitoring backend provided'));
|
||||
}
|
||||
|
||||
unset($this->config->{$name});
|
||||
$backendConfig = $this->config->getSection($name);
|
||||
$this->config->removeSection($name);
|
||||
return $backendConfig;
|
||||
}
|
||||
|
||||
|
@ -170,11 +170,11 @@ class BackendConfigForm extends ConfigForm
|
|||
if ($monitoringBackend !== null) {
|
||||
if ($monitoringBackend === '') {
|
||||
throw new ConfigurationError(mt('monitoring', 'Monitoring backend name missing'));
|
||||
} elseif (false === isset($this->config->{$monitoringBackend})) {
|
||||
} elseif (! $this->config->hasSection($monitoringBackend)) {
|
||||
throw new ConfigurationError(mt('monitoring', 'Unknown monitoring backend provided'));
|
||||
}
|
||||
|
||||
$backendConfig = $this->config->{$monitoringBackend}->toArray();
|
||||
$backendConfig = $this->config->getSection($monitoringBackend)->toArray();
|
||||
$backendConfig['name'] = $monitoringBackend;
|
||||
$this->populate($backendConfig);
|
||||
}
|
||||
|
|
|
@ -71,12 +71,12 @@ class InstanceConfigForm extends ConfigForm
|
|||
if (! $name) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Instance name missing'));
|
||||
}
|
||||
if (isset($this->config->{$name})) {
|
||||
if ($this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Instance already exists'));
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
$this->config->{$name} = $values;
|
||||
$this->config->setSection($name, $values);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -96,14 +96,13 @@ class InstanceConfigForm extends ConfigForm
|
|||
throw new InvalidArgumentException(mt('monitoring', 'Old instance name missing'));
|
||||
} elseif (! ($newName = isset($values['name']) ? $values['name'] : '')) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'New instance name missing'));
|
||||
} elseif (! ($instanceConfig = $this->config->get($name))) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Unknown instance name provided'));
|
||||
}
|
||||
|
||||
unset($values['name']);
|
||||
unset($this->config->{$name});
|
||||
$this->config->{$newName} = $values;
|
||||
return $this->config->{$newName};
|
||||
$this->config->setSection($name, $values);
|
||||
return $this->config->getSection($name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -119,11 +118,12 @@ class InstanceConfigForm extends ConfigForm
|
|||
{
|
||||
if (! $name) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Instance name missing'));
|
||||
} elseif (! ($instanceConfig = $this->config->get($name))) {
|
||||
} elseif (! $this->config->hasSection($name)) {
|
||||
throw new InvalidArgumentException(mt('monitoring', 'Unknown instance name provided'));
|
||||
}
|
||||
|
||||
unset($this->config->{$name});
|
||||
$instanceConfig = $this->config->getSection($name);
|
||||
$this->config->removeSection($name);
|
||||
return $instanceConfig;
|
||||
}
|
||||
|
||||
|
@ -138,11 +138,11 @@ class InstanceConfigForm extends ConfigForm
|
|||
if (! $instanceName) {
|
||||
throw new ConfigurationError(mt('monitoring', 'Instance name missing'));
|
||||
}
|
||||
if (! isset($this->config->{$instanceName})) {
|
||||
if (! $this->config->hasSection($instanceName)) {
|
||||
throw new ConfigurationError(mt('monitoring', 'Unknown instance name given'));
|
||||
}
|
||||
|
||||
$instanceConfig = $this->config->{$instanceName}->toArray();
|
||||
$instanceConfig = $this->config->getSection($instanceName)->toArray();
|
||||
$instanceConfig['name'] = $instanceName;
|
||||
$this->populate($instanceConfig);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class SecurityConfigForm extends ConfigForm
|
|||
*/
|
||||
public function onSuccess()
|
||||
{
|
||||
$this->config->security = $this->getValues();
|
||||
$this->config->setSection('security', $this->getValues());
|
||||
|
||||
if ($this->save()) {
|
||||
Notification::success(mt('monitoring', 'New security configuration has successfully been stored'));
|
||||
|
@ -40,9 +40,7 @@ class SecurityConfigForm extends ConfigForm
|
|||
*/
|
||||
public function onRequest()
|
||||
{
|
||||
if (isset($this->config->security)) {
|
||||
$this->populate($this->config->security->toArray());
|
||||
}
|
||||
$this->populate($this->config->getSection('security')->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<div class="controls">
|
||||
<?= $this->tabs->showOnlyCloseButton() ?>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<h1><?= $title ?></h1>
|
||||
<h1><?= $title ?> <?= /** @var \Icinga\Module\Monitoring\Forms\Command\CommandForm $form */ $this->icon('help', $form->getHelp()) ?></h1>
|
||||
<table class="objectlist">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<?= $this->tabs->showOnlyCloseButton() ?>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h1><?= $title ?></h1>
|
||||
<h1><?= $title ?> <?= $this->icon('help', $form->getHelp()) ?></h1>
|
||||
<?php if ((bool) $programStatus->notifications_enabled === false): ?>
|
||||
<div>
|
||||
<?= $this->translate('Host and service notifications are already disabled.') ?>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Icinga\Module\Monitoring\Backend;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Data\ConnectionInterface;
|
||||
use Icinga\Data\Queryable;
|
||||
|
@ -16,7 +17,7 @@ class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
|
|||
/**
|
||||
* Backend configuration
|
||||
*
|
||||
* @var Config
|
||||
* @var ConfigObject
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
|
@ -51,10 +52,10 @@ class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
|
|||
/**
|
||||
* Create a new backend
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $config
|
||||
* @param string $name
|
||||
* @param ConfigObject $config
|
||||
*/
|
||||
protected function __construct($name, $config)
|
||||
protected function __construct($name, ConfigObject $config)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->config = $config;
|
||||
|
@ -180,9 +181,9 @@ class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
|
|||
|
||||
} else {
|
||||
|
||||
$config = $backends->get($name);
|
||||
$config = $backends->getSection($name);
|
||||
|
||||
if ($config === null) {
|
||||
if ($config->isEmpty()) {
|
||||
throw new ConfigurationError(
|
||||
mt('monitoring', 'No configuration for backend %s'),
|
||||
$name
|
||||
|
|
|
@ -39,7 +39,7 @@ class BackendStep extends Step
|
|||
|
||||
try {
|
||||
$writer = new IniWriter(array(
|
||||
'config' => new Config($config),
|
||||
'config' => Config::fromArray($config),
|
||||
'filename' => Config::resolvePath('modules/monitoring/backends.ini')
|
||||
));
|
||||
$writer->write();
|
||||
|
@ -60,7 +60,7 @@ class BackendStep extends Step
|
|||
|
||||
try {
|
||||
$config = Config::app('resources', true);
|
||||
$config->merge(new Config(array($resourceName => $resourceConfig)));
|
||||
$config->setSection($resourceName, $resourceConfig);
|
||||
|
||||
$writer = new IniWriter(array(
|
||||
'config' => $config,
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
namespace Icinga\Module\Monitoring\Command\Transport;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +32,7 @@ abstract class CommandTransport
|
|||
{
|
||||
if (! isset(self::$config)) {
|
||||
self::$config = Config::module('monitoring', 'instances');
|
||||
if (self::$config->count() === 0) {
|
||||
if (self::$config->isEmpty()) {
|
||||
throw new ConfigurationError(
|
||||
'No instances have been configured in \'%s\'.',
|
||||
self::$config->getConfigFile()
|
||||
|
@ -44,12 +45,12 @@ abstract class CommandTransport
|
|||
/**
|
||||
* Create a transport from config
|
||||
*
|
||||
* @param Config $config
|
||||
* @param ConfigObject $config
|
||||
*
|
||||
* @return LocalCommandFile|RemoteCommandFile
|
||||
* @throws ConfigurationError
|
||||
*/
|
||||
public static function fromConfig(Config $config)
|
||||
public static function fromConfig(ConfigObject $config)
|
||||
{
|
||||
switch (strtolower($config->transport)) {
|
||||
case RemoteCommandFile::TRANSPORT:
|
||||
|
@ -90,8 +91,8 @@ abstract class CommandTransport
|
|||
*/
|
||||
public static function create($name)
|
||||
{
|
||||
$config = self::getConfig()->get($name);
|
||||
if ($config === null) {
|
||||
$config = self::getConfig()->getSection($name);
|
||||
if ($config->isEmpty()) {
|
||||
throw new ConfigurationError();
|
||||
}
|
||||
return self::fromConfig($config);
|
||||
|
|
|
@ -28,7 +28,7 @@ class InstanceStep extends Step
|
|||
|
||||
try {
|
||||
$writer = new IniWriter(array(
|
||||
'config' => new Config(array($instanceName => $instanceConfig)),
|
||||
'config' => Config::fromArray(array($instanceName => $instanceConfig)),
|
||||
'filename' => Config::resolvePath('modules/monitoring/instances.ini')
|
||||
));
|
||||
$writer->write();
|
||||
|
|
|
@ -290,10 +290,7 @@ abstract class MonitoredObject
|
|||
$blacklist = array();
|
||||
$blacklistPattern = '/^(.*pw.*|.*pass.*|community)$/i';
|
||||
|
||||
if ($security = Config::module('monitoring')->get('security')) {
|
||||
|
||||
$blacklistConfig = $security->get('protected_customvars', '');
|
||||
|
||||
if (($blacklistConfig = Config::module('monitoring')->get('security', 'protected_customvars', '')) !== '') {
|
||||
foreach (explode(',', $blacklistConfig) as $customvar) {
|
||||
$nonWildcards = array();
|
||||
foreach (explode('*', $customvar) as $nonWildcard) {
|
||||
|
|
|
@ -27,7 +27,7 @@ class SecurityStep extends Step
|
|||
|
||||
try {
|
||||
$writer = new IniWriter(array(
|
||||
'config' => new Config($config),
|
||||
'config' => Config::fromArray($config),
|
||||
'filename' => Config::resolvePath('modules/monitoring/config.ini')
|
||||
));
|
||||
$writer->write();
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Tests\Icinga\Module\Monitoring\Regression;
|
|||
require_once realpath(dirname(__FILE__) . '/../../../../../test/php/bootstrap.php');
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Module\Monitoring\Backend;
|
||||
use Icinga\Test\BaseTestCase;
|
||||
use Mockery;
|
||||
|
@ -45,7 +46,7 @@ class Bug7043Test extends BaseTestCase
|
|||
->getMock()
|
||||
);
|
||||
|
||||
ConfigWithSetModuleConfig::setModuleConfig('monitoring', 'backends', new Config(array(
|
||||
ConfigWithSetModuleConfig::setModuleConfig('monitoring', 'backends', new ConfigObject(array(
|
||||
'backendName' => array(
|
||||
'type' => 'ido',
|
||||
'resource' => 'ido'
|
||||
|
|
|
@ -6,8 +6,8 @@ namespace Icinga\Module\Setup\Forms;
|
|||
|
||||
use Exception;
|
||||
use LogicException;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Authentication\Backend\DbUserBackend;
|
||||
use Icinga\Authentication\Backend\LdapUserBackend;
|
||||
|
@ -253,10 +253,10 @@ class AdminAccountPage extends Form
|
|||
protected function fetchUsers()
|
||||
{
|
||||
if ($this->backendConfig['backend'] === 'db') {
|
||||
$backend = new DbUserBackend(ResourceFactory::createResource(new Config($this->resourceConfig)));
|
||||
$backend = new DbUserBackend(ResourceFactory::createResource(new ConfigObject($this->resourceConfig)));
|
||||
} elseif ($this->backendConfig['backend'] === 'ldap') {
|
||||
$backend = new LdapUserBackend(
|
||||
ResourceFactory::createResource(new Config($this->resourceConfig)),
|
||||
ResourceFactory::createResource(new ConfigObject($this->resourceConfig)),
|
||||
$this->backendConfig['user_class'],
|
||||
$this->backendConfig['user_name_attribute'],
|
||||
$this->backendConfig['base_dn']
|
||||
|
|