Multiple small updates

This commit is contained in:
“VeLiTi”
2024-08-20 09:02:10 +02:00
parent 5ab161c62d
commit 061fae6244
9 changed files with 93 additions and 14 deletions

View File

@@ -87,7 +87,7 @@ function format_form($contents) {
return $form;
}
if (isset($_POST) && !empty($_POST)) {
if (isset($_POST['submit']) && !empty($_POST)) {
// Update the configuration file with the new keys and values
foreach ($_POST as $k => $v) {
$v = in_array(strtolower($v), ['true', 'false']) ? strtolower($v) : '\'' . $v . '\'';
@@ -95,13 +95,18 @@ if (isset($_POST) && !empty($_POST)) {
}
file_put_contents('./settings/config.php', $contents);
//GEOLOCATION UPDATE
geolocationUpdate($_SESSION['userkey']);
//Return succesmessage
header('Location: index.php?page=settings&success_msg=1');
exit;
}
if (isset($_POST['geoupdate'])){
//GEOLOCATION UPDATE
geolocationUpdate($_SESSION['userkey']);
}
// Handle success messages
if (isset($_GET['success_msg'])) {
if ($_GET['success_msg'] == 1) {
@@ -118,6 +123,7 @@ $view .= '
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
<h2 class="responsive-width-100">Settings</h2>
<input type="submit" name="geoupdate" value="GeoUpdate" class="btn">
<input type="submit" name="submit" value="Save" class="btn">
</div>
';