diff --git a/index.php b/index.php index 201e1fc..d209c1a 100644 --- a/index.php +++ b/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; } \ No newline at end of file