[Pkg-nagios-changes] [pkg-icingaweb2] 01/02: Imported Upstream version 2.3.2
Markus Frosch
lazyfrosch at moszumanska.debian.org
Thu Apr 28 16:18:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
lazyfrosch pushed a commit to branch master
in repository pkg-icingaweb2.
commit c1aee5d6524505dd0969649d4595503e6c069a2d
Author: Markus Frosch <lazyfrosch at debian.org>
Date: Thu Apr 28 18:17:42 2016 +0200
Imported Upstream version 2.3.2
---
ChangeLog | 14 +++++++++++++
VERSION | 2 +-
application/VERSION | 2 +-
icingaweb2.spec | 2 +-
library/Icinga/Application/Version.php | 2 +-
library/Icinga/Repository/Repository.php | 5 +++--
library/Icinga/Web/Form/Element/DateTimePicker.php | 12 ++++++++++-
library/Icinga/Web/Navigation/DashboardPane.php | 22 +++++++++++++++++++++
library/Icinga/Web/Navigation/NavigationItem.php | 16 ++++++++++++++-
library/Icinga/Web/Widget/Dashboard.php | 11 +++++++++--
library/Icinga/Web/Widget/FilterEditor.php | 12 ++++++-----
modules/doc/module.info | 2 +-
.../application/controllers/ConfigController.php | 20 ++++++++++++++++---
.../Object/ScheduleHostDowntimeCommandForm.php | 17 ++++++++++++++++
.../Object/ScheduleServiceDowntimeCommandForm.php | 16 +++++++++++++++
.../locale/de_DE/LC_MESSAGES/monitoring.mo | Bin 75289 -> 72184 bytes
.../locale/de_DE/LC_MESSAGES/monitoring.po | 13 ++++++++----
.../views/scripts/list/eventhistory.phtml | 8 +++++++-
.../views/scripts/partials/event-history.phtml | 15 +++++++++++++-
modules/monitoring/module.info | 2 +-
modules/setup/module.info | 2 +-
modules/test/module.info | 2 +-
modules/translation/module.info | 2 +-
23 files changed, 170 insertions(+), 29 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b4a10a5..8954889 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
# Icinga Web 2 Changelog
+### What's New in Version 2.3.2
+
+#### Feature
+
+* Feature 11629: Simplified event-history date and time representation
+
+#### Bugfixes
+
+* Fix a privilege escalation issue in the monitoring module for authenticated users
+* Bug 10486: Menu rendering fails when no monitoring backend was configured
+* Bug 10847: Warn about illogical dates
+* Bug 10848: Can't change items per page if filter is in modify state
+* Bug 11392: Can't configure monitoring backend via the web interface when no monitoring backend was configured
+
## What's New
### What's New in Version 2.3.1
diff --git a/VERSION b/VERSION
index aaf7425..f706a60 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-v2.3.1
+v2.3.2
diff --git a/application/VERSION b/application/VERSION
index 2f1fe13..a57bad8 100644
--- a/application/VERSION
+++ b/application/VERSION
@@ -1 +1 @@
-33984532932863ba0292725c9bae55d1f1899d11 2016-04-18 01:13:04 +0200
+21e4ba56801f09985b853ecbc9598e6796fa69d6 2016-04-28 14:56:31 +0200
diff --git a/icingaweb2.spec b/icingaweb2.spec
index 3fc88e1..dbb8b61 100644
--- a/icingaweb2.spec
+++ b/icingaweb2.spec
@@ -3,7 +3,7 @@
%define revision 1
Name: icingaweb2
-Version: 2.3.1
+Version: 2.3.2
Release: %{revision}%{?dist}
Summary: Icinga Web 2
Group: Applications/System
diff --git a/library/Icinga/Application/Version.php b/library/Icinga/Application/Version.php
index 9cbddce..8e2863d 100644
--- a/library/Icinga/Application/Version.php
+++ b/library/Icinga/Application/Version.php
@@ -8,7 +8,7 @@ namespace Icinga\Application;
*/
class Version
{
- const VERSION = '2.3.1';
+ const VERSION = '2.3.2';
/**
* Get the version of this instance of Icinga Web 2
diff --git a/library/Icinga/Repository/Repository.php b/library/Icinga/Repository/Repository.php
index 581130e..df6a893 100644
--- a/library/Icinga/Repository/Repository.php
+++ b/library/Icinga/Repository/Repository.php
@@ -903,8 +903,9 @@ abstract class Repository implements Selectable
$blacklist = $this->getBlacklistedQueryColumns();
$columns = array();
foreach ($queryColumns[$table] as $alias => $column) {
- if (! in_array(is_string($alias) ? $alias : $column, $blacklist)) {
- $columns[$alias] = $this->resolveQueryColumnAlias($table, $alias);
+ $name = is_string($alias) ? $alias : $column;
+ if (! in_array($name, $blacklist)) {
+ $columns[$alias] = $this->resolveQueryColumnAlias($table, $name);
}
}
diff --git a/library/Icinga/Web/Form/Element/DateTimePicker.php b/library/Icinga/Web/Form/Element/DateTimePicker.php
index 2173c6c..f48742e 100644
--- a/library/Icinga/Web/Form/Element/DateTimePicker.php
+++ b/library/Icinga/Web/Form/Element/DateTimePicker.php
@@ -113,6 +113,16 @@ class DateTimePicker extends FormElement
}
/**
+ * Get the expected date and time format of any user input
+ *
+ * @return string
+ */
+ public function getFormat()
+ {
+ return $this->local ? 'Y-m-d\TH:i:s' : DateTime::RFC3339;
+ }
+
+ /**
* Is the date and time valid?
*
* @param string|DateTime $value
@@ -127,7 +137,7 @@ class DateTimePicker extends FormElement
}
if (! $value instanceof DateTime) {
- $format = $this->local === true ? 'Y-m-d\TH:i:s' : DateTime::RFC3339;
+ $format = $this->getFormat();
$dateTime = DateTime::createFromFormat($format, $value);
if ($dateTime === false) {
$dateTime = DateTime::createFromFormat(substr($format, 0, strrpos($format, ':')), $value);
diff --git a/library/Icinga/Web/Navigation/DashboardPane.php b/library/Icinga/Web/Navigation/DashboardPane.php
index 0212624..41d96be 100644
--- a/library/Icinga/Web/Navigation/DashboardPane.php
+++ b/library/Icinga/Web/Navigation/DashboardPane.php
@@ -17,6 +17,8 @@ class DashboardPane extends NavigationItem
*/
protected $dashlets;
+ protected $disabled;
+
/**
* Set this pane's dashlets
*
@@ -72,4 +74,24 @@ class DashboardPane extends NavigationItem
$item->getDashlets(false)
));
}
+
+ /**
+ * Set disabled state for pane
+ *
+ * @param bool $disabled
+ */
+ public function setDisabled($disabled=true)
+ {
+ $this->disabled = (bool) $disabled;
+ }
+
+ /**
+ * Get disabled state for pane
+ *
+ * @return bool
+ */
+ public function getDisabled()
+ {
+ return $this->disabled;
+ }
}
diff --git a/library/Icinga/Web/Navigation/NavigationItem.php b/library/Icinga/Web/Navigation/NavigationItem.php
index c699a6d..0f31a42 100644
--- a/library/Icinga/Web/Navigation/NavigationItem.php
+++ b/library/Icinga/Web/Navigation/NavigationItem.php
@@ -7,6 +7,7 @@ use Exception;
use InvalidArgumentException;
use IteratorAggregate;
use Icinga\Application\Icinga;
+use Icinga\Application\Logger;
use Icinga\Exception\IcingaException;
use Icinga\Exception\ProgrammingError;
use Icinga\Web\Navigation\Renderer\NavigationItemRenderer;
@@ -815,7 +816,20 @@ class NavigationItem implements IteratorAggregate
*/
public function render()
{
- return $this->getRenderer()->setItem($this)->render();
+ try {
+ return $this->getRenderer()->setItem($this)->render();
+ } catch (Exception $e) {
+ Logger::error(
+ 'Could not invoke custom navigation item renderer. %s in %s:%d with message: %s',
+ get_class($e),
+ $e->getFile(),
+ $e->getLine(),
+ $e->getMessage()
+ );
+
+ $renderer = new NavigationItemRenderer();
+ return $renderer->render($this);
+ }
}
/**
diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php
index ab47afb..405360c 100644
--- a/library/Icinga/Web/Widget/Dashboard.php
+++ b/library/Icinga/Web/Widget/Dashboard.php
@@ -373,8 +373,15 @@ class Dashboard extends AbstractWidget
*/
private function setDefaultPane()
{
- reset($this->panes);
- $active = key($this->panes);
+ $active = null;
+
+ foreach ($this->panes as $key=>$pane) {
+ if ($pane->getDisabled() === false) {
+ $active = $key;
+ break;
+ }
+ }
+
if ($active !== null) {
$this->activate($active);
}
diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php
index f512ffe..28e4968 100644
--- a/library/Icinga/Web/Widget/FilterEditor.php
+++ b/library/Icinga/Web/Widget/FilterEditor.php
@@ -323,11 +323,12 @@ class FilterEditor extends AbstractWidget
if ($request->get('cancel') === 'Cancel') {
$this->redirectNow($this->preservedUrl()->without('modifyFilter'));
}
-
- $filter = $this->applyChanges($request->getPost());
- $url = $this->url()->setQueryString($filter->toQueryString())->addParams($preserve);
- $url->getParams()->add('modifyFilter');
- $this->redirectNow($url);
+ if ($request->get('formUID') === 'FilterEditor') {
+ $filter = $this->applyChanges($request->getPost());
+ $url = $this->url()->setQueryString($filter->toQueryString())->addParams($preserve);
+ $url->getParams()->add('modifyFilter');
+ $this->redirectNow($url);
+ }
}
$this->url()->getParams()->add('modifyFilter');
}
@@ -780,6 +781,7 @@ class FilterEditor extends AbstractWidget
. '<input type="submit" name="submit" value="Apply" />'
. '<input type="submit" name="cancel" value="Cancel" />'
. '</div>'
+ . '<input type="hidden" name="formUID" value="FilterEditor">'
. '</form>'
. '</div>';
}
diff --git a/modules/doc/module.info b/modules/doc/module.info
index feeff98..e69a166 100644
--- a/modules/doc/module.info
+++ b/modules/doc/module.info
@@ -1,4 +1,4 @@
Module: doc
-Version: 2.3.1
+Version: 2.3.2
Description: Documentation module
Extracts, shows and exports documentation for Icinga Web 2 and its modules.
diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php
index feaa5bc..09aeb7d 100644
--- a/modules/monitoring/application/controllers/ConfigController.php
+++ b/modules/monitoring/application/controllers/ConfigController.php
@@ -8,8 +8,9 @@ use Icinga\Data\ResourceFactory;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotFoundError;
use Icinga\Forms\ConfirmRemovalForm;
+use Icinga\Web\Controller;
use Icinga\Web\Notification;
-use Icinga\Module\Monitoring\Controller;
+use Icinga\Module\Monitoring\Backend;
use Icinga\Module\Monitoring\Forms\Config\BackendConfigForm;
use Icinga\Module\Monitoring\Forms\Config\SecurityConfigForm;
use Icinga\Module\Monitoring\Forms\Config\TransportConfigForm;
@@ -20,6 +21,15 @@ use Icinga\Module\Monitoring\Forms\Config\TransportConfigForm;
class ConfigController extends Controller
{
/**
+ * {@inheritdoc}
+ */
+ public function init()
+ {
+ $this->assertPermission('config/modules');
+ parent::init();
+ }
+
+ /**
* Display a list of available backends and command transports
*/
public function indexAction()
@@ -199,7 +209,9 @@ class ConfigController extends Controller
$form->setRedirectUrl('monitoring/config');
$form->setTitle(sprintf($this->translate('Edit Command Transport %s'), $transportName));
$form->setIniConfig($this->Config('commandtransports'));
- $form->setInstanceNames($this->backend->select()->from('instance', array('instance_name'))->fetchColumn());
+ $form->setInstanceNames(
+ Backend::createBackend()->select()->from('instance', array('instance_name'))->fetchColumn()
+ );
$form->setOnSuccess(function (TransportConfigForm $form) use ($transportName) {
try {
$form->edit($transportName, array_map(
@@ -241,7 +253,9 @@ class ConfigController extends Controller
$form->setRedirectUrl('monitoring/config');
$form->setTitle($this->translate('Create New Command Transport'));
$form->setIniConfig($this->Config('commandtransports'));
- $form->setInstanceNames($this->backend->select()->from('instance', array('instance_name'))->fetchColumn());
+ $form->setInstanceNames(
+ Backend::createBackend()->select()->from('instance', array('instance_name'))->fetchColumn()
+ );
$form->setOnSuccess(function (TransportConfigForm $form) {
try {
$form->add(array_filter($form->getValues()));
diff --git a/modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php b/modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php
index 05d1451..003f3f0 100644
--- a/modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php
+++ b/modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php
@@ -3,6 +3,7 @@
namespace Icinga\Module\Monitoring\Forms\Command\Object;
+use DateTime;
use Icinga\Module\Monitoring\Command\Object\PropagateHostDowntimeCommand;
use Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand;
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
@@ -61,6 +62,22 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
*/
public function onSuccess()
{
+ $end = $this->getValue('end')->getTimestamp();
+ if ($end <= $this->getValue('start')->getTimestamp()) {
+ $endElement = $this->_elements['end'];
+ $endElement->setValue($endElement->getValue()->format($endElement->getFormat()));
+ $endElement->addError($this->translate('The end time must be greater than the start time'));
+ return false;
+ }
+
+ $now = new DateTime;
+ if ($end <= $now->getTimestamp()) {
+ $endElement = $this->_elements['end'];
+ $endElement->setValue($endElement->getValue()->format($endElement->getFormat()));
+ $endElement->addError($this->translate('A downtime must not be in the past'));
+ return false;
+ }
+
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\Host $object */
if (($childHostsEl = $this->getElement('child_hosts')) !== null) {
diff --git a/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php b/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php
index 9e6efb5..14ac851 100644
--- a/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php
+++ b/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php
@@ -197,6 +197,22 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
*/
public function onSuccess()
{
+ $end = $this->getValue('end')->getTimestamp();
+ if ($end <= $this->getValue('start')->getTimestamp()) {
+ $endElement = $this->_elements['end'];
+ $endElement->setValue($endElement->getValue()->format($endElement->getFormat()));
+ $endElement->addError($this->translate('The end time must be greater than the start time'));
+ return false;
+ }
+
+ $now = new DateTime;
+ if ($end <= $now->getTimestamp()) {
+ $endElement = $this->_elements['end'];
+ $endElement->setValue($endElement->getValue()->format($endElement->getFormat()));
+ $endElement->addError($this->translate('A downtime must not be in the past'));
+ return false;
+ }
+
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\Service $object */
$downtime = new ScheduleServiceDowntimeCommand();
diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo
index c28c8b3..3560dc3 100644
Binary files a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo and b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo differ
diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po
index c0e2ed8..79a04cf 100644
--- a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po
+++ b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po
@@ -2,21 +2,21 @@
# Copyright (C) 2016 Icinga Development Team
# This file is distributed under the same license as Monitoring Module.
# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
-#
-#, fuzzy
+#
msgid ""
msgstr ""
"Project-Id-Version: Monitoring Module (2.1.2)\n"
"Report-Msgid-Bugs-To: dev at icinga.org\n"
"POT-Creation-Date: 2016-02-29 14:40+0000\n"
-"PO-Revision-Date: 2015-11-16 14:50+0100\n"
+"PO-Revision-Date: 2016-04-26 12:08+0200\n"
"Last-Translator: Thomas Gelf <thomas at gelf.net>\n"
"Language: de_DE\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language-Team: \n"
+"X-Generator: Poedit 1.8.7.1\n"
#: /vagrant/modules/monitoring/application/controllers/ChartController.php:375
msgid " Down Hosts (Handled)"
@@ -4387,6 +4387,11 @@ msgstr "nicht erreichbar"
msgid "is reachable"
msgstr "erreichbar"
+#: /vagrant/modules/monitoring/application/views/scripts/partials/event-history.phtml:41
+msgctxt "date.verbose"
+msgid "%A, %B %e, %Y"
+msgstr "%A, %e. %B %Y"
+
#: /vagrant/modules/monitoring/application/views/scripts/alertsummary/index.phtml:35
msgid "notifications per hour"
msgstr "Benachrichtigungen per Stunde"
diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml
index 2ee788d..a14e8eb 100644
--- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml
+++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml
@@ -12,6 +12,12 @@ if (! $this->compact): ?>
<?php endif ?>
<?= $this->partial(
'partials/event-history.phtml',
- array('compact' => $this->compact, 'history' => $history, 'isOverview' => true, 'tableCssClass' => 'table-row-selectable')
+ array(
+ 'compact' => $this->compact,
+ 'history' => $history,
+ 'isOverview' => true,
+ 'tableCssClass' => 'table-row-selectable',
+ 'translationDomain' => $this->translationDomain
+ )
) ?>
diff --git a/modules/monitoring/application/views/scripts/partials/event-history.phtml b/modules/monitoring/application/views/scripts/partials/event-history.phtml
index 33e34ec..67236bd 100644
--- a/modules/monitoring/application/views/scripts/partials/event-history.phtml
+++ b/modules/monitoring/application/views/scripts/partials/event-history.phtml
@@ -31,6 +31,10 @@ $history->limit($limit * $page);
<p><?= $this->translate('No historical events found matching the filter.') ?></p>
</div>
<?php return; endif ?>
+<?php
+$dateFormat = $this->translate('%A, %B %e, %Y', 'date.verbose');
+$lastDate = null;
+?>
<table class="state-table" data-base-target="_next"<?php if (isset($tableCssClass)): ?> class="<?=$tableCssClass ?>"<?php endif ?>>
<tbody>
<?php foreach ($history->peekAhead() as $event):
@@ -104,13 +108,22 @@ $history->limit($limit * $page);
$label = $this->translate('DOWNTIME END');
break;
} ?>
+ <?php
+ $currentDate = strftime($dateFormat, (int) $event->timestamp);
+ if ($currentDate !== $lastDate):
+ $lastDate = $currentDate;
+ ?>
+ <tr>
+ <th colspan="2"><?= $currentDate ?></th>
+ </tr>
+ <?php endif ?>
<tr>
<td class="state-col state-<?= $stateName ?>">
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
<a id="page-<?= $history->getIteratorPosition() / $limit + 1 ?>"></a>
<?php endif ?>
<div class="state-label"><?= $this->escape($label) ?></div>
- <div class="state-meta"><?= $this->timeAgo($event->timestamp, $this->compact) ?></div>
+ <div class="state-meta"><?= $this->formatTime($event->timestamp) ?></div>
</td>
<td>
<?php if ($this->isOverview): ?>
diff --git a/modules/monitoring/module.info b/modules/monitoring/module.info
index fc03dc2..f7e69d5 100644
--- a/modules/monitoring/module.info
+++ b/modules/monitoring/module.info
@@ -1,5 +1,5 @@
Module: monitoring
-Version: 2.3.1
+Version: 2.3.2
Description: Icinga monitoring module
This is the core module for most Icingaweb users. It provides an
abstraction layer for various Icinga data backends.
diff --git a/modules/setup/module.info b/modules/setup/module.info
index 03d7857..7ca7e69 100644
--- a/modules/setup/module.info
+++ b/modules/setup/module.info
@@ -1,5 +1,5 @@
Module: setup
-Version: 2.3.1
+Version: 2.3.2
Description: Setup module
Web based wizard for setting up Icinga Web 2 and its modules.
This includes the data backends (e.g. relational database, LDAP),
diff --git a/modules/test/module.info b/modules/test/module.info
index 866cbf3..03ad308 100644
--- a/modules/test/module.info
+++ b/modules/test/module.info
@@ -1,5 +1,5 @@
Module: test
-Version: 2.3.1
+Version: 2.3.2
Description: Translation module
This module allows developers to run (unit) tests against Icinga Web 2 and
any of its modules. Usually you do not need to enable this.
diff --git a/modules/translation/module.info b/modules/translation/module.info
index 8d3d41b..5ae61f7 100644
--- a/modules/translation/module.info
+++ b/modules/translation/module.info
@@ -1,5 +1,5 @@
Module: translation
-Version: 2.3.1
+Version: 2.3.2
Description: Translation module
This module allows developers and translators to translate Icinga Web 2 and
its modules for multiple languages. You do not need this module to run an
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-icingaweb2.git
More information about the Pkg-nagios-changes
mailing list