Bugfixes theme changer page
parent
6617b3bb28
commit
522d84f203
|
@ -9,6 +9,10 @@
|
||||||
* - switch_to: Changes the active theme for the current user
|
* - switch_to: Changes the active theme for the current user
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Initialize security
|
||||||
|
require_once '../app/helpers/security.php';
|
||||||
|
$security = SecurityHelper::getInstance();
|
||||||
|
|
||||||
// Only allow access to logged-in users
|
// Only allow access to logged-in users
|
||||||
if (!Session::isValidSession()) {
|
if (!Session::isValidSession()) {
|
||||||
header('Location: ' . $app_root . '?page=login');
|
header('Location: ' . $app_root . '?page=login');
|
||||||
|
@ -20,9 +24,6 @@ if (isset($_GET['switch_to'])) {
|
||||||
$themeName = $_GET['switch_to'];
|
$themeName = $_GET['switch_to'];
|
||||||
|
|
||||||
// Validate CSRF token for state-changing operations
|
// Validate CSRF token for state-changing operations
|
||||||
require_once '../app/helpers/security.php';
|
|
||||||
$security = SecurityHelper::getInstance();
|
|
||||||
|
|
||||||
if (!$security->verifyCsrfToken($_GET['csrf_token'] ?? '')) {
|
if (!$security->verifyCsrfToken($_GET['csrf_token'] ?? '')) {
|
||||||
Feedback::flash('SECURITY', 'CSRF_INVALID');
|
Feedback::flash('SECURITY', 'CSRF_INVALID');
|
||||||
header("Location: $app_root?page=theme");
|
header("Location: $app_root?page=theme");
|
||||||
|
|
Loading…
Reference in New Issue