From b7e0e5c5eb79a83b9d64732ad6796b9f2614876a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 9 Oct 2025 13:00:00 -0400 Subject: [PATCH] Fix setup complete flag --- setup/index.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/setup/index.php b/setup/index.php index 94d2f6dc..4846e981 100644 --- a/setup/index.php +++ b/setup/index.php @@ -325,15 +325,12 @@ if (isset($_POST['restore'])) { // --- 8) Cleanup temp dir --- deleteDir($tempDir); - // --- 9) Finalize setup flag (idempotent) --- - try { - setConfigFlag("../config.php", "config_enable_setup", 0); - } catch (Throwable $e) { - // Non-fatal; warn but continue to login - $_SESSION['alert_message'] = "Backup restored, but failed to finalize setup flag in config.php: " . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8'); - header("Location: ../login.php"); - exit; - } + // --- 9) Finalize setup flag --- + $myfile = fopen("../config.php", "a"); + $txt = "\$config_enable_setup = 0;\n\n"; + + fwrite($myfile, $txt); + fclose($myfile); // --- 10) Done --- $_SESSION['alert_message'] = "Full backup restored successfully.";