mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Moved admin_ to /admin, user_ to user report_ to /reports each have their own post includes modals directories created seperate headers and footer. Also did the same for xcustom, more work to me done
This commit is contained in:
54
admin/post/settings_theme.php
Normal file
54
admin/post/settings_theme.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
defined('FROM_POST_HANDLER') || die("Direct file access is not allowed");
|
||||
|
||||
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");
|
||||
|
||||
// Logging
|
||||
logAction("Settings", "Edit", "$session_name edited theme settings $dark_mode");
|
||||
|
||||
$_SESSION['alert_message'] = "Changed theme to <strong>$theme</strong>";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
|
||||
if (isset($_POST['edit_favicon_settings'])) {
|
||||
|
||||
validateCSRFToken($_POST['csrf_token']);
|
||||
|
||||
// Check to see if a file is attached
|
||||
if (isset($_FILES['file']['tmp_name'])) {
|
||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('ico'))) {
|
||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||
|
||||
// Delete old file
|
||||
if(file_exists("uploads/favicon.ico")) {
|
||||
unlink("uploads/favicon.ico");
|
||||
}
|
||||
|
||||
// directory in which the uploaded file will be moved
|
||||
$upload_file_dir = "uploads/";
|
||||
//Force File Name
|
||||
$new_file_name = "favicon.ico";
|
||||
$dest_path = $upload_file_dir . $new_file_name;
|
||||
|
||||
move_uploaded_file($file_tmp_path, $dest_path);
|
||||
}
|
||||
}
|
||||
|
||||
// Logging
|
||||
logAction("Settings", "Edit", "$session_name changed the favicon");
|
||||
|
||||
$_SESSION['alert_message'] = "Favicon Updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user