mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
monitoring: Fix HTTP response code when showing an invalid downtime
refs #6281
This commit is contained in:
parent
5e520e7b59
commit
8f42d7a1d3
@ -35,8 +35,8 @@ class Monitoring_DowntimeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$downtimeId = $this->params->get('downtime_id');
|
$downtimeId = $this->params->getRequired('downtime_id');
|
||||||
|
|
||||||
$this->downtime = $this->backend->select()->from('downtime', array(
|
$this->downtime = $this->backend->select()->from('downtime', array(
|
||||||
'id' => 'downtime_internal_id',
|
'id' => 'downtime_internal_id',
|
||||||
'objecttype' => 'downtime_objecttype',
|
'objecttype' => 'downtime_objecttype',
|
||||||
@ -60,17 +60,17 @@ class Monitoring_DowntimeController extends Controller
|
|||||||
'host_display_name',
|
'host_display_name',
|
||||||
'service_display_name'
|
'service_display_name'
|
||||||
))->where('downtime_internal_id', $downtimeId)->getQuery()->fetchRow();
|
))->where('downtime_internal_id', $downtimeId)->getQuery()->fetchRow();
|
||||||
|
|
||||||
if (false === $this->downtime) {
|
if ($this->downtime === false) {
|
||||||
throw new Zend_Controller_Action_Exception($this->translate('Downtime not found'));
|
$this->httpNotFound($this->translate('Downtime not found'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->downtime->service_description)) {
|
if (isset($this->downtime->service_description)) {
|
||||||
$this->isService = true;
|
$this->isService = true;
|
||||||
} else {
|
} else {
|
||||||
$this->isService = false;
|
$this->isService = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->getTabs()
|
$this->getTabs()
|
||||||
->add(
|
->add(
|
||||||
'downtime',
|
'downtime',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user