= $this->escape($this->translate('Access denied')) ?>
+escape($this->translate('Access to host "%s" denied')), $host) ?>
+diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php new file mode 100644 index 0000000..134ab5b --- /dev/null +++ b/application/controllers/HostController.php @@ -0,0 +1,24 @@ +params->getRequired('host'); + + $query = $this->backend->select() + ->from('hoststatus', array('host_name')) + ->where('host_name', $host); + + if ($this->applyRestriction('monitoring/filter/objects', $query)->fetchRow() !== false) { + $this->redirectNow(Url::fromPath('monitoring/host/show')->setParams($this->params)); + } + + $this->view->host = $host; + } +} diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php new file mode 100644 index 0000000..17bb474 --- /dev/null +++ b/application/controllers/ServiceController.php @@ -0,0 +1,27 @@ +params->getRequired('host'); + $service = $this->params->getRequired('service'); + + $query = $this->backend->select() + ->from('servicestatus', array('service_description')) + ->where('host_name', $host) + ->where('service_description', $service); + + if ($this->applyRestriction('monitoring/filter/objects', $query)->fetchRow() !== false) { + $this->redirectNow(Url::fromPath('monitoring/service/show')->setParams($this->params)); + } + + $this->view->host = $host; + $this->view->service = $service; + } +} diff --git a/application/views/scripts/host/show.phtml b/application/views/scripts/host/show.phtml new file mode 100644 index 0000000..1455c80 --- /dev/null +++ b/application/views/scripts/host/show.phtml @@ -0,0 +1,12 @@ + +
escape($this->translate('Access to host "%s" denied')), $host) ?>
+escape($this->translate('Access to service "%s" of host "%s" denied')), + $service, + $host + ) ?>
+