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 - +
+ + + Create First User + + + Restore from Backup + + + + Begin Setup + +