Merge branch 'master' into bugfix/error-prone-generictts-9611

Conflicts:
	modules/monitoring/application/views/scripts/show/components/downtime.phtml
This commit is contained in:
Eric Lippmann 2015-08-03 15:05:45 +02:00
commit 688a08585b
23 changed files with 102 additions and 62 deletions

View File

@ -1,6 +1,11 @@
define icingaweb2::config::general (
$source,
$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'),
$replace = true
) {

View File

@ -24,14 +24,11 @@ class openldap {
}
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
['core', 'cosine', 'inetorgperson', 'nis', 'misc', 'openldap'].each |String $schema| {
exec { "slapd-schema-${schema}":
command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${schema}.ldif",
group => 'root',
require => Package['openldap-servers'],
unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${schema}.ldif -print -quit)\"",
user => 'root',
}
}
openldap::schema{ 'core': }
-> openldap::schema{ 'cosine': }
-> openldap::schema{ 'inetorgperson': }
-> openldap::schema{ 'nis': }
-> openldap::schema{ 'misc': }
-> openldap::schema{ 'openldap': }
}
}

View 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',
}
}

View File

@ -24,7 +24,5 @@ class php {
require => Package['apache'],
}
php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]:
require => Package['php'],
}
php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]: }
}

View File

@ -17,5 +17,6 @@ define php::phpd {
file { "/etc/php.d/$name.ini":
content => template("php/$name.ini.erb"),
notify => Service['apache'],
require => Package['php'],
}
}

4
Vagrantfile vendored
View File

@ -22,9 +22,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :path => ".puppet/manifests/puppet.sh"
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, "--cpus", "2"]
end
config.vm.provider :parallels do |p, override|

View File

@ -75,10 +75,12 @@ class LdapUserGroupBackendForm extends Form
: $resourceNames[0]
);
$userBackends = array('none' => $this->translate('None', 'usergroupbackend.ldap.user_backend'));
$userBackendNames = $this->getLdapUserBackendNames($resource);
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(
'select',
@ -101,20 +103,10 @@ class LdapUserGroupBackendForm extends Form
$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->createUserConfigElements($defaults, $userConfigDisabled, $dnDisabled);
if (count($userBackends) === 1 || (isset($formData['user_backend']) && $formData['user_backend'] === 'none')) {
$this->createUserConfigElements($defaults, $userConfigDisabled);
}
$this->addElement(
'hidden',
@ -212,9 +204,8 @@ class LdapUserGroupBackendForm extends Form
*
* @param ConfigObject $defaults
* @param null|bool $disabled
* @param null|bool $dnDisabled
*/
protected function createUserConfigElements(ConfigObject $defaults, $disabled, $dnDisabled)
protected function createUserConfigElements(ConfigObject $defaults, $disabled)
{
$this->addElement(
'text',
@ -234,8 +225,6 @@ class LdapUserGroupBackendForm extends Form
array(
'preserveDefault' => true,
'allowEmpty' => true,
'ignore' => $dnDisabled,
'disabled' => $dnDisabled,
'label' => $this->translate('LDAP User Filter'),
'description' => $this->translate(
'An additional filter to use when looking up users using the specified connection. '
@ -281,8 +270,6 @@ class LdapUserGroupBackendForm extends Form
'user_base_dn',
array(
'preserveDefault' => true,
'ignore' => $dnDisabled,
'disabled' => $dnDisabled,
'label' => $this->translate('LDAP User Base DN'),
'description' => $this->translate(
'The path where users can be found on the LDAP server. Leave ' .

View File

@ -36,7 +36,7 @@ class Dashboard extends AbstractWidget
*
* @var Tabs
*/
private $tabs;
protected $tabs;
/**
* The parameter that will be added to identify panes

View File

@ -19,6 +19,25 @@ class SearchDashboard extends Dashboard
*/
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
*

View File

@ -1,4 +1,4 @@
<div data-base-target='_next' class="controls">
<div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>

View File

@ -1,4 +1,4 @@
<div data-base-target='_next' class="controls">
<div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>

View File

@ -49,8 +49,8 @@ if (empty($object->comments) && ! $addLink) {
<?php foreach ($object->downtimes as $downtime):
if ((bool) $downtime->is_in_effect) {
$state = sprintf(
$this->translate('in downtime %s', 'Last format parameter represents the time in downtime'),
$this->timeSince($downtime->start)
$this->translate('expires %s', 'Last format parameter represents the downtime expire time'),
$this->timeUntil($downtime->end)
);
} else {
if ((bool) $downtime->is_fixed) {

View File

@ -62,7 +62,7 @@ class Comment extends DataView
*/
public function getSearchColumns()
{
return array('host', 'host_display_name', 'service', 'service_display_name', 'comment_author');
return array('host_display_name', 'service_display_name');
}
/**

View File

@ -79,14 +79,6 @@ class Contact extends DataView
*/
public function getSearchColumns()
{
return array(
'contact',
'contact_alias',
'contact_email',
'host',
'host_display_name',
'service',
'service_display_name'
);
return array('contact_alias');
}
}

View File

@ -84,6 +84,6 @@ class Contactgroup extends DataView
*/
public function getSearchColumns()
{
return array('contactgroup', 'contactgroup_alias', 'contact', 'contact_alias', 'contact_email');
return array('contactgroup_alias');
}
}

View File

@ -69,7 +69,7 @@ class Downtime extends DataView
*/
public function getSearchColumns()
{
return array('downtime_author', 'host', 'host_display_name', 'service', 'service_display_name');
return array('host_display_name', 'service_display_name');
}
/**

View File

@ -72,6 +72,6 @@ class EventHistory extends DataView
*/
public function getSearchColumns()
{
return array('host', 'host_display_name', 'service', 'service_display_name', 'type');
return array('host_display_name', 'service_display_name');
}
}

View File

@ -60,7 +60,7 @@ class Hostgroupsummary extends DataView
*/
public function getSearchColumns()
{
return array('host', 'host_display_name', 'hostgroup', 'hostgroup_alias');
return array('hostgroup_alias');
}
/**

View File

@ -84,7 +84,7 @@ class HostStatus extends DataView
*/
public function getSearchColumns()
{
return array('host', 'host_display_name');
return array('host_display_name');
}
/**

View File

@ -90,6 +90,6 @@ class Notification extends DataView
*/
public function getSearchColumns()
{
return array('contact', 'host', 'host_display_name', 'service', 'service_display_name');
return array('host_display_name', 'service_display_name');
}
}

View File

@ -55,7 +55,7 @@ class Servicegroupsummary extends DataView
*/
public function getSearchColumns()
{
return array('service', 'service_display_name', 'servicegroup', 'servicegroup_alias');
return array('servicegroup_alias');
}
/**

View File

@ -191,6 +191,6 @@ class ServiceStatus extends DataView
*/
public function getSearchColumns()
{
return array('host', 'host_display_name', 'service', 'service_display_name');
return array('host_display_name', 'service_display_name');
}
}

View File

@ -104,15 +104,30 @@ class UserGroupBackendPage extends Form
ResourceFactory::setConfig($this->createResourceConfiguration());
UserBackend::setConfig($this->createBackendConfiguration());
$formData['type'] = 'ldap';
$formData['user_backend'] = $this->backendConfig['name']; // We're forcing the linkage anyway..
$backendForm = new LdapUserGroupBackendForm();
$formData['type'] = 'ldap';
$backendForm->create($formData);
$userBackendOptions = $backendForm->getElement('user_backend')->getMultiOptions();
unset($userBackendOptions['none']);
$backendForm->getElement('name')->setValue('icingaweb2');
$backendForm->getElement('user_backend')->setMultiOptions($userBackendOptions);
$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')
)
);
}
/**