Fixes login issues
parent
cb26576eeb
commit
15320854f3
|
@ -49,7 +49,7 @@ if (isset($_COOKIE['username'])) {
|
|||
}
|
||||
|
||||
// redirect to login
|
||||
if ( !isset($_SESSION['user_id']) && ($page !== 'login' && $page !== 'register') ) {
|
||||
if ( !isset($_COOKIE['username']) && ($page !== 'login' && $page !== 'register') ) {
|
||||
header('Location: index.php?page=login');
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<div class="menu-container">
|
||||
<ul class="menu-left">
|
||||
<li><a href="index.php">home</a></li>
|
||||
<?php if ( isset($_SESSION['user_id']) ) { ?>
|
||||
<?php if ( isset($_SESSION['username']) ) { ?>
|
||||
<li><a href="?page=config">config</a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<ul class="menu-right">
|
||||
<?php if ( isset($_SESSION['user_id']) ) { ?>
|
||||
<?php if ( isset($_SESSION['username']) ) { ?>
|
||||
<li><a href="?page=profile"><?= $user ?></a></li>
|
||||
<li><a href="?page=logout">logout</a></li>
|
||||
<?php } else { ?>
|
||||
|
|
Loading…
Reference in New Issue