mirror of https://github.com/itflow-org/itflow
Fix setup complete flag
This commit is contained in:
parent
2915b12181
commit
b7e0e5c5eb
|
|
@ -325,15 +325,12 @@ if (isset($_POST['restore'])) {
|
||||||
// --- 8) Cleanup temp dir ---
|
// --- 8) Cleanup temp dir ---
|
||||||
deleteDir($tempDir);
|
deleteDir($tempDir);
|
||||||
|
|
||||||
// --- 9) Finalize setup flag (idempotent) ---
|
// --- 9) Finalize setup flag ---
|
||||||
try {
|
$myfile = fopen("../config.php", "a");
|
||||||
setConfigFlag("../config.php", "config_enable_setup", 0);
|
$txt = "\$config_enable_setup = 0;\n\n";
|
||||||
} catch (Throwable $e) {
|
|
||||||
// Non-fatal; warn but continue to login
|
fwrite($myfile, $txt);
|
||||||
$_SESSION['alert_message'] = "Backup restored, but failed to finalize setup flag in config.php: " . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8');
|
fclose($myfile);
|
||||||
header("Location: ../login.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- 10) Done ---
|
// --- 10) Done ---
|
||||||
$_SESSION['alert_message'] = "Full backup restored successfully.";
|
$_SESSION['alert_message'] = "Full backup restored successfully.";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue