Redirect to /login when there is no session (enforcing) + New templates

This commit is contained in:
Niko 2022-02-11 00:05:26 +01:00
parent cc186de4aa
commit c396898925
4 changed files with 27 additions and 3 deletions

View File

@ -0,0 +1,2 @@
</body>
</html>

View File

@ -0,0 +1,15 @@
<html>
<head>
<title><?php echo $title ?? '' ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- TODO: include later
<link rel="manifest" href="/manifest.json">
<link rel="stylesheet" href="/fonts/forkawesome/css/fork-awesome.min.css">
<script type="application/javascript" src="/js/dayjs.min.js"></script>
<script type="application/javascript" src="/js/relativeTime.js"></script>
<script type="application/javascript" src="/js/updateLocale.js"></script>
-->
<?php tpl_styles($styles ?? null) ?>
<?php tpl_scripts($scripts ?? null) ?>
</head>
<body>

View File

@ -1,6 +1,6 @@
<html>
<head>
<title><?php echo $title ?></title>
<title><?php echo $title ?? '' ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- TODO: include later
<link rel="manifest" href="/manifest.json">

View File

@ -1,5 +1,12 @@
<?php require 'base.php' ?>
<?php session_enforce() ?>
<?php session_enforce(APP_DIR.'/login') ?>
<?php
echo $_SERVER['REQUEST_URI'];
$args = urlargs(1);
$uri = '/'.implode('/', $args);
?>
<?php tpl('app.header') ?>
<main>
APP HERE
</main>
<?php tpl('app.footer') ?>