From b53b3a924a874e1f9a30455ba4779d9df7364744 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 12 Nov 2023 13:08:40 +0100 Subject: [PATCH] fix wrong database-update procedure in update-command, fix distribution guessing on installation Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cli/UpdateCommand.php | 2 +- lib/Froxlor/Install/Install.php | 2 +- lib/init.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/Cli/UpdateCommand.php b/lib/Froxlor/Cli/UpdateCommand.php index 46abca47..56efc4af 100644 --- a/lib/Froxlor/Cli/UpdateCommand.php +++ b/lib/Froxlor/Cli/UpdateCommand.php @@ -175,7 +175,7 @@ final class UpdateCommand extends CliCommand $result = self::SUCCESS; $question = new ConfirmationQuestion('Update database? [no] ', false, '/^(y|j)/i'); if ($yestoall || $helper->ask($input, $output, $question)) { - $result = $this->updateDatabase(); + $result = $this->runUpdate($output, true); } } else { $errmsg = 'error.autoupdate_' . $auex; diff --git a/lib/Froxlor/Install/Install.php b/lib/Froxlor/Install/Install.php index 1e97e00c..190c2eb9 100644 --- a/lib/Froxlor/Install/Install.php +++ b/lib/Froxlor/Install/Install.php @@ -410,7 +410,7 @@ class Install } else { $osrf = explode("\n", file_get_contents('/etc/os-release')); foreach ($osrf as $line) { - $osrfline = explode("\n", $line); + $osrfline = explode("=", $line); if ($osrfline[0] == 'VERSION_CODENAME') { $os_dist['VERSION_CODENAME'] = $osrfline[1]; } else if ($osrfline[0] == 'ID') { diff --git a/lib/init.php b/lib/init.php index 7c4d914d..af28cf12 100644 --- a/lib/init.php +++ b/lib/init.php @@ -115,6 +115,7 @@ if (!isset($sql) || !is_array($sql)) { * Show nice note if requested domain is "unknown" to froxlor and thus is being lead to its vhost */ if ($_SERVER['SERVER_NAME'] != Settings::Get('system.hostname') && + Settings::Get('panel.is_configured') == 1 && !filter_var($_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP) && ( empty(Settings::Get('system.froxloraliases')) || (!empty(Settings::Get('system.froxloraliases')) && !in_array($_SERVER['SERVER_NAME'], array_map('trim', explode(',', Settings::Get('system.froxloraliases')))))