From 77be5af4e5fa6d1c43a4d8531b5a8597b437924e Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 24 May 2025 12:28:34 -0400 Subject: [PATCH] Update setup to include restore option but place it in its own nav section for seperation. Also if DB and config is configured skip and do not show checks or database in the side nav --- assets.php | 2 +- setup.php | 41 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/assets.php b/assets.php index ad5c230e..402b0ee1 100644 --- a/assets.php +++ b/assets.php @@ -519,7 +519,7 @@ if (mysqli_num_rows($os_sql) > 0) { if ($contact_name) { $contact_name_display = " $contact_name $contact_archive_display diff --git a/setup.php b/setup.php index 9d1a4661..2854e748 100644 --- a/setup.php +++ b/setup.php @@ -8,7 +8,6 @@ if (file_exists("config.php")) { include "functions.php"; include "includes/database_version.php"; - if (!isset($config_enable_setup)) { $config_enable_setup = 1; } @@ -18,6 +17,18 @@ if ($config_enable_setup == 0) { exit; } +$mysqli_available = isset($mysqli) && $mysqli instanceof mysqli; +$db_tables_exist = false; + +if ($mysqli_available) { + $check = mysqli_query($mysqli, "SHOW TABLES LIKE 'users'"); + if ($check && mysqli_num_rows($check) > 0) { + $db_tables_exist = true; + } +} + +$minimal_setup_mode = file_exists("config.php") && $config_enable_setup == 1 && $mysqli_available && $db_tables_exist; + include_once "includes/settings_localization_array.php"; $errorLog = ini_get('error_log') ?: "Debian/Ubuntu default is usually /var/log/apache2/error.log"; @@ -584,6 +595,7 @@ if (isset($_POST['add_telemetry'])) { @@ -1360,10 +1382,19 @@ if (isset($_POST['add_telemetry'])) { } ?>
-
- - Begin Setup - +