Migrate Dark/light mode to a user settings instead of global setting, created new include called router.php to dynamically prepend ../../ to asset pathes based off currect directory depth

This commit is contained in:
johnnyq
2025-08-05 13:32:19 -04:00
parent 7e55808a05
commit 08dd6147f2
16 changed files with 48 additions and 26 deletions

View File

@@ -6,11 +6,9 @@ if (isset($_POST['edit_theme_settings'])) {
validateCSRFToken($_POST['csrf_token']);
$dark_mode = intval($_POST['dark_mode'] ?? 0);
$theme = preg_replace("/[^0-9a-zA-Z-]/", "", sanitizeInput($_POST['edit_theme_settings']));
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme', config_theme_dark = $dark_mode WHERE company_id = 1");
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme' WHERE company_id = 1");
logAction("Settings", "Edit", "$session_name edited theme settings $dark_mode");