mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
monitoring: Don't offer the Icinga 2 API as transport if cURL is missing
fixes #2661
This commit is contained in:
parent
e83e317cc6
commit
35ba15a7a6
@ -4,6 +4,7 @@
|
||||
namespace Icinga\Module\Monitoring\Forms\Config;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Icinga\Application\Platform;
|
||||
use Icinga\Exception\IcingaException;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
use Icinga\Forms\ConfigForm;
|
||||
@ -224,6 +225,9 @@ class TransportConfigForm extends ConfigForm
|
||||
LocalCommandFile::TRANSPORT => $this->translate('Local Command File'),
|
||||
RemoteCommandFile::TRANSPORT => $this->translate('Remote Command File')
|
||||
);
|
||||
if (! Platform::extensionLoaded('curl')) {
|
||||
unset($transportTypes[ApiCommandTransport::TRANSPORT]);
|
||||
}
|
||||
|
||||
$transportType = isset($formData['transport']) ? $formData['transport'] : null;
|
||||
if ($transportType === null) {
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -212,6 +212,15 @@ class MonitoringWizard extends Wizard implements SetupWizard
|
||||
)));
|
||||
$backendSet->merge($pgsqlSet);
|
||||
$set->merge($backendSet);
|
||||
$set->add(new PhpModuleRequirement(array(
|
||||
'optional' => true,
|
||||
'condition' => 'curl',
|
||||
'alias' => 'cURL',
|
||||
'description' => mt(
|
||||
'monitoring',
|
||||
'To send external commands over Icinga 2\'s API the cURL module for PHP is required.'
|
||||
)
|
||||
)));
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user