Skip to content

Commit

Permalink
DbResourcePage: Warn the user if Icinga DB is used as configuration d…
Browse files Browse the repository at this point in the history
…atabase
  • Loading branch information
sukhwinder33445 authored and nilmerg committed Aug 7, 2024
1 parent c27ca26 commit 62cae50
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions modules/setup/application/forms/DbResourcePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 62cae50

Please sign in to comment.