From 863bf0886482986d6488d3e41e21c641c85fc04d Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 25 Feb 2016 17:48:32 +0100 Subject: [PATCH] Use isIcinga2() in the ToggleInstanceFeaturesCommandForm --- modules/monitoring/application/controllers/HealthController.php | 1 + .../Command/Instance/ToggleInstanceFeaturesCommandForm.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/HealthController.php b/modules/monitoring/application/controllers/HealthController.php index 1614e72e0..999ea99aa 100644 --- a/modules/monitoring/application/controllers/HealthController.php +++ b/modules/monitoring/application/controllers/HealthController.php @@ -93,6 +93,7 @@ class HealthController extends Controller $this->view->programStatus = $programStatus; $toggleFeaturesForm = new ToggleInstanceFeaturesCommandForm(); $toggleFeaturesForm + ->setBackend($this->backend) ->setStatus($programStatus) ->load($programStatus) ->handleRequest(); diff --git a/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php b/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php index 6e6ae83d3..ed50466fe 100644 --- a/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php +++ b/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php @@ -138,7 +138,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm ) ); - if (! preg_match('~^v2\.\d+\.\d+.*$~', $this->status->program_version)) { + if (! $this->getBackend()->isIcinga2($this->status->program_version)) { $this->addElement( 'checkbox', ToggleInstanceFeatureCommand::FEATURE_HOST_OBSESSING,