monitoring: Fix HTTP response code when showing an invalid host

refs #6281
This commit is contained in:
Eric Lippmann 2015-05-20 10:38:00 +02:00
parent e8c704b98d
commit 0b81a1130f
1 changed files with 2 additions and 4 deletions

View File

@ -21,17 +21,15 @@ class Monitoring_HostController extends MonitoredObjectController
/**
* Fetch the requested host from the monitoring backend
*
* @throws Zend_Controller_Action_Exception If the host was not found
*/
public function init()
{
$host = new Host($this->backend, $this->params->get('host'));
$host = new Host($this->backend, $this->params->getRequired('host'));
$this->applyRestriction('monitoring/hosts/filter', $host);
if ($host->fetch() === false) {
throw new Zend_Controller_Action_Exception($this->translate('Host not found'));
$this->httpNotFound($this->translate('Host not found'));
}
$this->object = $host;
$this->createTabs();