31 lines
831 B
PHP
Executable File
31 lines
831 B
PHP
Executable File
<?php
|
|
|
|
session_start();
|
|
|
|
if (!isset($_SESSION['userAccreditation']) || !isset($_SESSION['userLevel'])) {
|
|
$_SESSION['userAccreditation'] = 0;
|
|
$_SESSION['userLevel'] = 0;
|
|
}
|
|
|
|
if (!isset($_COOKIE['theme'])) {
|
|
$theme = random_int(0, 2);
|
|
setcookie('theme', $theme, time()+10*60*60, "/", ".e59.fr");
|
|
$darkTheme = $darkThemes[$theme];
|
|
$lightTheme = $lightThemes[$theme];
|
|
}
|
|
|
|
if (isset($_GET['theme'])) {
|
|
$newTheme = (int)$_GET['theme'] % 3;
|
|
setcookie('theme', $newTheme, time()+10*60*60, "/", ".e59.fr"); // % 2 => Number of different themes
|
|
$darkTheme = $darkThemes[$newTheme];
|
|
$lightTHeme = $lightThemes[$newTheme];
|
|
|
|
} else if (isset($_COOKIE['theme'])) {
|
|
$theme = (int)$_COOKIE['theme'] % 3;
|
|
$darkTheme = $darkThemes[$theme];
|
|
$lightTheme = $lightThemes[$theme];
|
|
}
|
|
|
|
$status = "";
|
|
|
|
?>
|