1
0
Fork 0
forked from CRSS/Website

feat: get logged in user in index.php

This commit is contained in:
TheClashFruit 2023-09-15 17:28:11 +02:00
parent 0689c5f844
commit 5758aee730
Signed by: TheClashFruit
GPG key ID: CF4A319B9A73290C

View file

@ -5,21 +5,18 @@
session_start();
if(isset($_SESSION['user']))
$twig->addGlobal('user', $_SESSION['user']);
switch ($_SERVER['REQUEST_URI']) {
case "/":
echo $twig->render('index.twig', [
'user' => null
]);
echo $twig->render('index.twig');
break;
case "/nations":
echo $twig->render('nations.twig', [
'user' => null
]);
echo $twig->render('nations.twig');
break;
default:
http_response_code(404);
echo $twig->render('404.twig', [
'user' => null
]);
echo $twig->render('404.twig');
break;
}