Implements the session class
parent
f77e15bf44
commit
522cded113
|
@ -9,9 +9,9 @@ if (!($userObject->hasRight($user_id, 'superuser') ||
|
|||
exit;
|
||||
}
|
||||
|
||||
if (!isset($currentUser)) {
|
||||
include '../app/templates/error-unauthorized.php';
|
||||
exit;
|
||||
if (!Session::getUsername()) {
|
||||
header('Location: ' . htmlspecialchars($app_root) . '?page=login');
|
||||
exit();
|
||||
}
|
||||
|
||||
// Get current section
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<?php if (isset($currentUser) && $page !== 'logout') { ?>
|
||||
<?php if (Session::getUsername() && $page !== 'logout') { ?>
|
||||
<script src="static/js/sidebar.js"></script>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="<?= htmlspecialchars($app_root) ?>static/css/main.css">
|
||||
<link rel="stylesheet" type="text/css" href="<?= htmlspecialchars($app_root) ?>static/css/messages.css">
|
||||
<script src="<?= htmlspecialchars($app_root) ?>static/js/messages.js"></script>
|
||||
<?php if (isset($currentUser)) { ?>
|
||||
<?php if (Session::getUsername()) { ?>
|
||||
<script>
|
||||
// restore sidebar state before the page is rendered
|
||||
(function () {
|
||||
|
|
Loading…
Reference in New Issue