ServiceController: trust the id if given

This way we are able to load invalid objects

fixes #1172
This commit is contained in:
Thomas Gelf 2017-09-12 10:32:14 +02:00
parent d83cf594cc
commit 89660a500a
1 changed files with 6 additions and 1 deletions

View File

@ -231,7 +231,12 @@ class ServiceController extends ObjectController
protected function loadObject()
{
if ($this->object === null) {
if ($name = $this->params->get('name')) {
if ($id = $this->params->get('id')) {
$this->object = IcingaService::loadWithAutoIncId(
(int) $id,
$this->db()
);
} elseif ($name = $this->params->get('name')) {
$params = array('object_name' => $name);
$db = $this->db();