IcingaHostSelfServiceForm: fail early if template
...is not for Agents
This commit is contained in:
parent
cd92429a60
commit
ad791918bc
|
@ -71,6 +71,13 @@ class IcingaHostSelfServiceForm extends DirectorForm
|
|||
throw new NotFoundError('Got invalid API key "%s"', $key);
|
||||
}
|
||||
|
||||
if ($this->template->getResolvedProperty('has_agent') !== 'y') {
|
||||
throw new NotFoundError(
|
||||
'Got valid API key "%s", but template is not for Agents',
|
||||
$key
|
||||
);
|
||||
}
|
||||
|
||||
$this->removeElement('key');
|
||||
|
||||
return $this->template;
|
||||
|
|
Loading…
Reference in New Issue