forked from CRSS/Website
feat: get logged in user in index.php
This commit is contained in:
parent
0689c5f844
commit
5758aee730
15
index.php
15
index.php
|
@ -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;
|
||||
}
|
Loading…
Reference in a new issue