From 2d4205916bf7c6b7da21882a0b79bd0fecae9af9 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Fri, 6 Sep 2024 19:03:08 +0300 Subject: [PATCH] Fixes bug in config editing --- app/pages/config.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/pages/config.php b/app/pages/config.php index 8998b3a..2d2d989 100644 --- a/app/pages/config.php +++ b/app/pages/config.php @@ -39,23 +39,23 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { } - - // check if file is writable - if (!is_writable($config_file)) { - $_SESSION['error'] = getError('Configuration file is not writable.'); - header("Location: $app_root?platform=$platform_id&page=config"); - exit(); - } - - // try to update the config file - if (file_put_contents($config_file, $updatedContent) !== false) { - // update successful - $_SESSION['notice'] = "Configuration for {$_POST['name']} is updated."; - } else { - // unsuccessful - $error = error_get_last(); - $_SESSION['error'] = getError('Error updating the config: ' . ($error['message'] ?? 'unknown error')); - } +// FIXME - if this is not needed for editing the flat file, remove it +// // check if file is writable +// if (!is_writable($config_file)) { +// $_SESSION['error'] = getError('Configuration file is not writable.'); +// header("Location: $app_root?platform=$platform_id&page=config"); +// exit(); +// } +// +// // try to update the config file +// if (file_put_contents($config_file, $updatedContent) !== false) { +// // update successful +// $_SESSION['notice'] = "Configuration for {$_POST['name']} is updated."; +// } else { +// // unsuccessful +// $error = error_get_last(); +// $_SESSION['error'] = getError('Error updating the config: ' . ($error['message'] ?? 'unknown error')); +// } // FIXME the new file is not loaded on first page load unset($config);