From 62cae50f1ee6d15e54a0dda966a4987afc9474d7 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 9 Apr 2024 17:23:04 +0200 Subject: [PATCH] DbResourcePage: Warn the user if Icinga DB is used as configuration database --- .../setup/application/forms/DbResourcePage.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/setup/application/forms/DbResourcePage.php b/modules/setup/application/forms/DbResourcePage.php index a417710f42..11a581327b 100644 --- a/modules/setup/application/forms/DbResourcePage.php +++ b/modules/setup/application/forms/DbResourcePage.php @@ -129,12 +129,18 @@ protected function validateConfiguration() $connectionError = $e; } - if ($connectionError === null && array_search('icinga_instances', $db->listTables(), true) !== false) { + if ($connectionError === null + && ( + in_array('icinga_instances', $db->listTables(), true) + || in_array('icingadb_instance', $db->listTables(), true) + ) + ) { $this->warning($this->translate( - 'The database you\'ve configured to use for Icinga Web 2 seems to be the one of Icinga. Please be aware' - . ' that this database configuration is supposed to be used for Icinga Web 2\'s configuration and that' - . ' it is highly recommended to not mix different schemas in the same database. If this is intentional,' - . ' you can skip the validation and ignore this warning. If not, please provide a different database.' + 'The database you\'ve configured to use for Icinga Web seems to be the one of Icinga 2' + . ' / Icinga DB. Please be aware that this database configuration is supposed to be used for' + . ' Icinga Web\'s configuration and that it is highly recommended to not mix different schemas' + . ' in the same database. If this is intentional, you can skip the validation and ignore this' + . ' warning. If not, please provide a different database.' )); $state = false; }