From 7f49dd826d62266f775ca7c8589b176d3dcc82b4 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 30 Aug 2023 17:27:14 +0200 Subject: [PATCH 1/3] IcingaDbWizard: Read required library versions from `Module` class --- library/Icingadb/Setup/IcingaDbWizard.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/Icingadb/Setup/IcingaDbWizard.php b/library/Icingadb/Setup/IcingaDbWizard.php index 2ad514a5b..07b337574 100644 --- a/library/Icingadb/Setup/IcingaDbWizard.php +++ b/library/Icingadb/Setup/IcingaDbWizard.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Icingadb\Setup; +use Icinga\Application\Icinga; use Icinga\Module\Setup\Forms\SummaryPage; use Icinga\Module\Setup\Requirement\PhpModuleRequirement; use Icinga\Module\Setup\Requirement\PhpVersionRequirement; @@ -55,14 +56,16 @@ public function getRequirements() 'description' => sprintf(t('Icinga DB Web requires PHP version %s.'), '7.2') ])); + $requiredVersions = Icinga::app()->getModuleManager()->getModule('icingadb')->getRequiredLibraries(); + $set->add(new WebLibraryRequirement([ - 'condition' => ['icinga-php-library', '>=', '0.9.0'], + 'condition' => ['icinga-php-library', '', $requiredVersions['icinga-php-library']], 'alias' => 'Icinga PHP library', 'description' => t('The Icinga PHP library (IPL) is required for Icinga DB Web') ])); $set->add(new WebLibraryRequirement([ - 'condition' => ['icinga-php-thirdparty', '>=', '0.11.0'], + 'condition' => ['icinga-php-thirdparty', '', $requiredVersions['icinga-php-thirdparty']], 'alias' => 'Icinga PHP Thirdparty', 'description' => t('The Icinga PHP Thirdparty library is required for Icinga DB Web') ])); From 2b046ecf1f2b88ba0c74dab3db94958764594644 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 31 Aug 2023 09:04:28 +0200 Subject: [PATCH 2/3] IcingaDbWizard: Update the module requirements - The php version requirement has been removed as it is already defined in icingaweb. --- library/Icingadb/Setup/IcingaDbWizard.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/Icingadb/Setup/IcingaDbWizard.php b/library/Icingadb/Setup/IcingaDbWizard.php index 07b337574..f99f240a2 100644 --- a/library/Icingadb/Setup/IcingaDbWizard.php +++ b/library/Icingadb/Setup/IcingaDbWizard.php @@ -7,7 +7,6 @@ use Icinga\Application\Icinga; use Icinga\Module\Setup\Forms\SummaryPage; use Icinga\Module\Setup\Requirement\PhpModuleRequirement; -use Icinga\Module\Setup\Requirement\PhpVersionRequirement; use Icinga\Module\Setup\Requirement\WebLibraryRequirement; use Icinga\Module\Setup\RequirementSet; use Icinga\Module\Setup\Setup; @@ -51,11 +50,6 @@ public function getRequirements() { $set = new RequirementSet(); - $set->add(new PhpVersionRequirement([ - 'condition' => ['>=', '7.2'], - 'description' => sprintf(t('Icinga DB Web requires PHP version %s.'), '7.2') - ])); - $requiredVersions = Icinga::app()->getModuleManager()->getModule('icingadb')->getRequiredLibraries(); $set->add(new WebLibraryRequirement([ @@ -76,6 +70,12 @@ public function getRequirements() 'description' => t('For check plugins that output HTML the libxml extension is required') ])); + $set->add(new PhpModuleRequirement([ + 'condition' => 'dom', + 'alias' => 'dom', + 'description' => t('For check plugins that output HTML the dom extension is required') + ])); + $set->add(new PhpModuleRequirement([ 'condition' => 'curl', 'alias' => 'cURL', From b2a512dc1b6148d8842101d2cfa5f05385411256 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 31 Aug 2023 15:28:02 +0200 Subject: [PATCH 3/3] Forms: Don't `autocomplete` password elements - Setting `autocomplete` to `off` does not work, but `new-password` does. --- application/forms/RedisConfigForm.php | 2 ++ library/Icingadb/Setup/ApiTransportPage.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/forms/RedisConfigForm.php b/application/forms/RedisConfigForm.php index 89aaf7b1a..bd3db9cc0 100644 --- a/application/forms/RedisConfigForm.php +++ b/application/forms/RedisConfigForm.php @@ -144,6 +144,7 @@ public function createElements(array $formData) 'description' => t('Redis Password'), 'label' => t('Redis Password'), 'renderPassword' => true, + 'autocomplete' => 'new-password' ]); $this->addDisplayGroup( @@ -182,6 +183,7 @@ public function createElements(array $formData) 'description' => t('Redis Password'), 'label' => t('Redis Password'), 'renderPassword' => true, + 'autocomplete' => 'new-password' ]); $this->addDisplayGroup( diff --git a/library/Icingadb/Setup/ApiTransportPage.php b/library/Icingadb/Setup/ApiTransportPage.php index 310933ae0..e727e9977 100644 --- a/library/Icingadb/Setup/ApiTransportPage.php +++ b/library/Icingadb/Setup/ApiTransportPage.php @@ -60,7 +60,8 @@ public function createElements(array $formData) $this->addElement('password', 'password', [ 'required' => true, 'renderPassword' => true, - 'label' => t('API Password') + 'label' => t('API Password'), + 'autocomplete' => 'new-password' ]); }