Use isIcinga2() in the ToggleInstanceFeaturesCommandForm

This commit is contained in:
Eric Lippmann 2016-02-25 17:48:32 +01:00
parent 47b3019940
commit 863bf08864
2 changed files with 2 additions and 1 deletions

View File

@ -93,6 +93,7 @@ class HealthController extends Controller
$this->view->programStatus = $programStatus; $this->view->programStatus = $programStatus;
$toggleFeaturesForm = new ToggleInstanceFeaturesCommandForm(); $toggleFeaturesForm = new ToggleInstanceFeaturesCommandForm();
$toggleFeaturesForm $toggleFeaturesForm
->setBackend($this->backend)
->setStatus($programStatus) ->setStatus($programStatus)
->load($programStatus) ->load($programStatus)
->handleRequest(); ->handleRequest();

View File

@ -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( $this->addElement(
'checkbox', 'checkbox',
ToggleInstanceFeatureCommand::FEATURE_HOST_OBSESSING, ToggleInstanceFeatureCommand::FEATURE_HOST_OBSESSING,