Backend: Remove unnecessary calls to isAvailable()
This commit is contained in:
parent
eeaf87741a
commit
db7181c29e
|
@ -568,7 +568,6 @@ class HostController extends ObjectController
|
|||
try {
|
||||
$backend = $this->backend();
|
||||
if ($host instanceof IcingaHost
|
||||
&& $backend->isAvailable()
|
||||
&& $host->isObject()
|
||||
&& $backend->hasHost($host->getObjectName())
|
||||
) {
|
||||
|
|
|
@ -44,8 +44,7 @@ class HostActions extends HostActionsHook
|
|||
$allowEdit = true;
|
||||
}
|
||||
if (Util::hasPermission('director/monitoring/hosts')) {
|
||||
$backend = new IcingadbBackend();
|
||||
if ($backend->isAvailable() && $backend->canModifyHost($hostname)) {
|
||||
if ((new IcingadbBackend())->canModifyHost($hostname)) {
|
||||
$allowEdit = IcingaHost::exists($hostname, $db);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,10 +56,7 @@ class ServiceActions extends ServiceActionsHook
|
|||
if (Util::hasPermission('director/hosts')) {
|
||||
$title = mt('director', 'Modify');
|
||||
} elseif (Util::hasPermission('director/monitoring/services')) {
|
||||
$backend = new IcingadbBackend();
|
||||
if ($backend->isAvailable()
|
||||
&& $backend->canModifyService($hostname, $serviceName)
|
||||
) {
|
||||
if ((new IcingadbBackend())->canModifyService($hostname, $serviceName)) {
|
||||
$title = mt('director', 'Modify');
|
||||
}
|
||||
} elseif (Util::hasPermission('director/monitoring/services-ro')) {
|
||||
|
|
Loading…
Reference in New Issue