monitoring: Fix HTTP response code when showing an invalid downtime

refs #6281
This commit is contained in:
Eric Lippmann 2015-05-21 17:17:25 +02:00
parent 5e520e7b59
commit 8f42d7a1d3
1 changed files with 7 additions and 7 deletions

View File

@ -35,7 +35,7 @@ class Monitoring_DowntimeController extends Controller
*/
public function init()
{
$downtimeId = $this->params->get('downtime_id');
$downtimeId = $this->params->getRequired('downtime_id');
$this->downtime = $this->backend->select()->from('downtime', array(
'id' => 'downtime_internal_id',
@ -61,8 +61,8 @@ class Monitoring_DowntimeController extends Controller
'service_display_name'
))->where('downtime_internal_id', $downtimeId)->getQuery()->fetchRow();
if (false === $this->downtime) {
throw new Zend_Controller_Action_Exception($this->translate('Downtime not found'));
if ($this->downtime === false) {
$this->httpNotFound($this->translate('Downtime not found'));
}
if (isset($this->downtime->service_description)) {