mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Merge branch 'master' into bugfix/error-prone-generictts-9611
Conflicts: modules/monitoring/application/views/scripts/show/components/downtime.phtml
This commit is contained in:
commit
688a08585b
@ -1,6 +1,11 @@
|
|||||||
define icingaweb2::config::general (
|
define icingaweb2::config::general (
|
||||||
$source,
|
$source,
|
||||||
$config = hiera('icingaweb2::config'),
|
$config = hiera('icingaweb2::config'),
|
||||||
|
$log = hiera('icingaweb2::log'),
|
||||||
|
$web_path = hiera('icingaweb2::web_path'),
|
||||||
|
$db_user = hiera('icingaweb2::db_user'),
|
||||||
|
$db_pass = hiera('icingaweb2::db_pass'),
|
||||||
|
$db_name = hiera('icingaweb2::db_name'),
|
||||||
$web_group = hiera('icingaweb2::group'),
|
$web_group = hiera('icingaweb2::group'),
|
||||||
$replace = true
|
$replace = true
|
||||||
) {
|
) {
|
||||||
|
@ -24,14 +24,11 @@ class openldap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
|
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
|
||||||
['core', 'cosine', 'inetorgperson', 'nis', 'misc', 'openldap'].each |String $schema| {
|
openldap::schema{ 'core': }
|
||||||
exec { "slapd-schema-${schema}":
|
-> openldap::schema{ 'cosine': }
|
||||||
command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${schema}.ldif",
|
-> openldap::schema{ 'inetorgperson': }
|
||||||
group => 'root',
|
-> openldap::schema{ 'nis': }
|
||||||
require => Package['openldap-servers'],
|
-> openldap::schema{ 'misc': }
|
||||||
unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${schema}.ldif -print -quit)\"",
|
-> openldap::schema{ 'openldap': }
|
||||||
user => 'root',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
24
.puppet/modules/openldap/manifests/schema.pp
Normal file
24
.puppet/modules/openldap/manifests/schema.pp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# define: openldap::schema
|
||||||
|
#
|
||||||
|
# Install a schema.
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
#
|
||||||
|
# Actions:
|
||||||
|
#
|
||||||
|
# Requires:
|
||||||
|
#
|
||||||
|
# Sample Usage:
|
||||||
|
#
|
||||||
|
define openldap::schema {
|
||||||
|
|
||||||
|
include openldap
|
||||||
|
|
||||||
|
exec { "openldap-schema-${name}":
|
||||||
|
command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${name}.ldif",
|
||||||
|
group => 'root',
|
||||||
|
require => Service['slapd'],
|
||||||
|
unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${name}.ldif -print -quit)\"",
|
||||||
|
user => 'root',
|
||||||
|
}
|
||||||
|
}
|
@ -24,7 +24,5 @@ class php {
|
|||||||
require => Package['apache'],
|
require => Package['apache'],
|
||||||
}
|
}
|
||||||
|
|
||||||
php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]:
|
php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]: }
|
||||||
require => Package['php'],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,5 +17,6 @@ define php::phpd {
|
|||||||
file { "/etc/php.d/$name.ini":
|
file { "/etc/php.d/$name.ini":
|
||||||
content => template("php/$name.ini.erb"),
|
content => template("php/$name.ini.erb"),
|
||||||
notify => Service['apache'],
|
notify => Service['apache'],
|
||||||
|
require => Package['php'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
Vagrantfile
vendored
4
Vagrantfile
vendored
@ -22,9 +22,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||||||
config.vm.provision :shell, :path => ".puppet/manifests/puppet.sh"
|
config.vm.provision :shell, :path => ".puppet/manifests/puppet.sh"
|
||||||
|
|
||||||
config.vm.provider :virtualbox do |v, override|
|
config.vm.provider :virtualbox do |v, override|
|
||||||
override.vm.box = "puppetlabs/centos-7.0-64-puppet"
|
override.vm.box = "centos-71-x64-vbox"
|
||||||
|
override.vm.box_url = "http://boxes.icinga.org/centos-71-x64-vbox.box"
|
||||||
|
|
||||||
v.customize ["modifyvm", :id, "--memory", "1024"]
|
v.customize ["modifyvm", :id, "--memory", "1024"]
|
||||||
|
v.customize ["modifyvm", :id, "--cpus", "2"]
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.provider :parallels do |p, override|
|
config.vm.provider :parallels do |p, override|
|
||||||
|
@ -75,10 +75,12 @@ class LdapUserGroupBackendForm extends Form
|
|||||||
: $resourceNames[0]
|
: $resourceNames[0]
|
||||||
);
|
);
|
||||||
|
|
||||||
$userBackends = array('none' => $this->translate('None', 'usergroupbackend.ldap.user_backend'));
|
|
||||||
$userBackendNames = $this->getLdapUserBackendNames($resource);
|
$userBackendNames = $this->getLdapUserBackendNames($resource);
|
||||||
if (! empty($userBackendNames)) {
|
if (! empty($userBackendNames)) {
|
||||||
$userBackends = array_merge($userBackends, array_combine($userBackendNames, $userBackendNames));
|
$userBackends = array_combine($userBackendNames, $userBackendNames);
|
||||||
|
$userBackends['none'] = $this->translate('None', 'usergroupbackend.ldap.user_backend');
|
||||||
|
} else {
|
||||||
|
$userBackends = array('none' => $this->translate('None', 'usergroupbackend.ldap.user_backend'));
|
||||||
}
|
}
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
@ -101,20 +103,10 @@ class LdapUserGroupBackendForm extends Form
|
|||||||
$groupConfigDisabled = $userConfigDisabled = true;
|
$groupConfigDisabled = $userConfigDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dnDisabled = null; // MUST BE null
|
|
||||||
if (isset($formData['user_backend']) && $formData['user_backend'] !== 'none') {
|
|
||||||
$userBackend = UserBackend::create($formData['user_backend']);
|
|
||||||
$defaults->merge(array(
|
|
||||||
'user_base_dn' => $userBackend->getBaseDn(),
|
|
||||||
'user_class' => $userBackend->getUserClass(),
|
|
||||||
'user_name_attribute' => $userBackend->getUserNameAttribute(),
|
|
||||||
'user_filter' => $userBackend->getFilter()
|
|
||||||
));
|
|
||||||
$userConfigDisabled = $dnDisabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->createGroupConfigElements($defaults, $groupConfigDisabled);
|
$this->createGroupConfigElements($defaults, $groupConfigDisabled);
|
||||||
$this->createUserConfigElements($defaults, $userConfigDisabled, $dnDisabled);
|
if (count($userBackends) === 1 || (isset($formData['user_backend']) && $formData['user_backend'] === 'none')) {
|
||||||
|
$this->createUserConfigElements($defaults, $userConfigDisabled);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'hidden',
|
'hidden',
|
||||||
@ -212,9 +204,8 @@ class LdapUserGroupBackendForm extends Form
|
|||||||
*
|
*
|
||||||
* @param ConfigObject $defaults
|
* @param ConfigObject $defaults
|
||||||
* @param null|bool $disabled
|
* @param null|bool $disabled
|
||||||
* @param null|bool $dnDisabled
|
|
||||||
*/
|
*/
|
||||||
protected function createUserConfigElements(ConfigObject $defaults, $disabled, $dnDisabled)
|
protected function createUserConfigElements(ConfigObject $defaults, $disabled)
|
||||||
{
|
{
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
@ -234,8 +225,6 @@ class LdapUserGroupBackendForm extends Form
|
|||||||
array(
|
array(
|
||||||
'preserveDefault' => true,
|
'preserveDefault' => true,
|
||||||
'allowEmpty' => true,
|
'allowEmpty' => true,
|
||||||
'ignore' => $dnDisabled,
|
|
||||||
'disabled' => $dnDisabled,
|
|
||||||
'label' => $this->translate('LDAP User Filter'),
|
'label' => $this->translate('LDAP User Filter'),
|
||||||
'description' => $this->translate(
|
'description' => $this->translate(
|
||||||
'An additional filter to use when looking up users using the specified connection. '
|
'An additional filter to use when looking up users using the specified connection. '
|
||||||
@ -281,8 +270,6 @@ class LdapUserGroupBackendForm extends Form
|
|||||||
'user_base_dn',
|
'user_base_dn',
|
||||||
array(
|
array(
|
||||||
'preserveDefault' => true,
|
'preserveDefault' => true,
|
||||||
'ignore' => $dnDisabled,
|
|
||||||
'disabled' => $dnDisabled,
|
|
||||||
'label' => $this->translate('LDAP User Base DN'),
|
'label' => $this->translate('LDAP User Base DN'),
|
||||||
'description' => $this->translate(
|
'description' => $this->translate(
|
||||||
'The path where users can be found on the LDAP server. Leave ' .
|
'The path where users can be found on the LDAP server. Leave ' .
|
||||||
|
@ -36,7 +36,7 @@ class Dashboard extends AbstractWidget
|
|||||||
*
|
*
|
||||||
* @var Tabs
|
* @var Tabs
|
||||||
*/
|
*/
|
||||||
private $tabs;
|
protected $tabs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parameter that will be added to identify panes
|
* The parameter that will be added to identify panes
|
||||||
|
@ -19,6 +19,25 @@ class SearchDashboard extends Dashboard
|
|||||||
*/
|
*/
|
||||||
const SEARCH_PANE = 'search';
|
const SEARCH_PANE = 'search';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getTabs()
|
||||||
|
{
|
||||||
|
if ($this->tabs === null) {
|
||||||
|
$this->tabs = new Tabs();
|
||||||
|
$this->tabs->add(
|
||||||
|
'search',
|
||||||
|
array(
|
||||||
|
'title' => t('Show Search', 'dashboard.pane.tooltip'),
|
||||||
|
'label' => t('Search'),
|
||||||
|
'url' => Url::fromRequest()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $this->tabs;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load all available search dashlets from modules
|
* Load all available search dashlets from modules
|
||||||
*
|
*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div data-base-target='_next' class="controls">
|
<div class="controls">
|
||||||
<?php if (! $this->compact): ?>
|
<?php if (! $this->compact): ?>
|
||||||
<?= $tabs; ?>
|
<?= $tabs; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div data-base-target='_next' class="controls">
|
<div class="controls">
|
||||||
|
|
||||||
<?php if (! $this->compact): ?>
|
<?php if (! $this->compact): ?>
|
||||||
<?= $tabs; ?>
|
<?= $tabs; ?>
|
||||||
|
@ -49,8 +49,8 @@ if (empty($object->comments) && ! $addLink) {
|
|||||||
<?php foreach ($object->downtimes as $downtime):
|
<?php foreach ($object->downtimes as $downtime):
|
||||||
if ((bool) $downtime->is_in_effect) {
|
if ((bool) $downtime->is_in_effect) {
|
||||||
$state = sprintf(
|
$state = sprintf(
|
||||||
$this->translate('in downtime %s', 'Last format parameter represents the time in downtime'),
|
$this->translate('expires %s', 'Last format parameter represents the downtime expire time'),
|
||||||
$this->timeSince($downtime->start)
|
$this->timeUntil($downtime->end)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if ((bool) $downtime->is_fixed) {
|
if ((bool) $downtime->is_fixed) {
|
||||||
|
@ -62,7 +62,7 @@ class Comment extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('host', 'host_display_name', 'service', 'service_display_name', 'comment_author');
|
return array('host_display_name', 'service_display_name');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,14 +79,6 @@ class Contact extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array(
|
return array('contact_alias');
|
||||||
'contact',
|
|
||||||
'contact_alias',
|
|
||||||
'contact_email',
|
|
||||||
'host',
|
|
||||||
'host_display_name',
|
|
||||||
'service',
|
|
||||||
'service_display_name'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,6 @@ class Contactgroup extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('contactgroup', 'contactgroup_alias', 'contact', 'contact_alias', 'contact_email');
|
return array('contactgroup_alias');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class Downtime extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('downtime_author', 'host', 'host_display_name', 'service', 'service_display_name');
|
return array('host_display_name', 'service_display_name');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,6 +72,6 @@ class EventHistory extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('host', 'host_display_name', 'service', 'service_display_name', 'type');
|
return array('host_display_name', 'service_display_name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class Hostgroupsummary extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('host', 'host_display_name', 'hostgroup', 'hostgroup_alias');
|
return array('hostgroup_alias');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +84,7 @@ class HostStatus extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('host', 'host_display_name');
|
return array('host_display_name');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,6 +90,6 @@ class Notification extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('contact', 'host', 'host_display_name', 'service', 'service_display_name');
|
return array('host_display_name', 'service_display_name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class Servicegroupsummary extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('service', 'service_display_name', 'servicegroup', 'servicegroup_alias');
|
return array('servicegroup_alias');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,6 +191,6 @@ class ServiceStatus extends DataView
|
|||||||
*/
|
*/
|
||||||
public function getSearchColumns()
|
public function getSearchColumns()
|
||||||
{
|
{
|
||||||
return array('host', 'host_display_name', 'service', 'service_display_name');
|
return array('host_display_name', 'service_display_name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,15 +104,30 @@ class UserGroupBackendPage extends Form
|
|||||||
ResourceFactory::setConfig($this->createResourceConfiguration());
|
ResourceFactory::setConfig($this->createResourceConfiguration());
|
||||||
UserBackend::setConfig($this->createBackendConfiguration());
|
UserBackend::setConfig($this->createBackendConfiguration());
|
||||||
|
|
||||||
$formData['type'] = 'ldap';
|
|
||||||
$formData['user_backend'] = $this->backendConfig['name']; // We're forcing the linkage anyway..
|
|
||||||
$backendForm = new LdapUserGroupBackendForm();
|
$backendForm = new LdapUserGroupBackendForm();
|
||||||
|
$formData['type'] = 'ldap';
|
||||||
$backendForm->create($formData);
|
$backendForm->create($formData);
|
||||||
$userBackendOptions = $backendForm->getElement('user_backend')->getMultiOptions();
|
|
||||||
unset($userBackendOptions['none']);
|
|
||||||
$backendForm->getElement('name')->setValue('icingaweb2');
|
$backendForm->getElement('name')->setValue('icingaweb2');
|
||||||
$backendForm->getElement('user_backend')->setMultiOptions($userBackendOptions);
|
|
||||||
$this->addSubForm($backendForm, 'backend_form');
|
$this->addSubForm($backendForm, 'backend_form');
|
||||||
|
|
||||||
|
$backendForm->addElement(
|
||||||
|
'hidden',
|
||||||
|
'resource',
|
||||||
|
array(
|
||||||
|
'required' => true,
|
||||||
|
'value' => $this->resourceConfig['name'],
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$backendForm->addElement(
|
||||||
|
'hidden',
|
||||||
|
'user_backend',
|
||||||
|
array(
|
||||||
|
'required' => true,
|
||||||
|
'value' => $this->backendConfig['name'],
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user