diff options
Diffstat (limited to 'includes/templates/header.php')
-rw-r--r-- | includes/templates/header.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/templates/header.php b/includes/templates/header.php index 4eb17e3..35d9848 100644 --- a/includes/templates/header.php +++ b/includes/templates/header.php @@ -5,8 +5,12 @@ [<a href="/create_thread.php">Create a thread</a>] <span style="float:right;"> <?php - if (isset($_SESSION['signed_in'])) { - echo '[<a href="viewuser.php?id='. $_SESSION['user_id'] .'">' . $_SESSION['user_name'] . '\'s Profile</a>] [<a href="includes/signout_inc.php">Log out</a>]'; + include_once './includes/Session.php'; + include_once './includes/model/User.php'; + + if (Session::get()->is_signed_in()) { + $user = Session::get()->get_current_user(); + echo '[<a href="viewuser.php?id=' . $user->id . '">' . $user->name . '\'s Profile</a>] [<a href="includes/signout_inc.php">Log out</a>]'; } else { echo '[<a href="signin.php">Sign in</a>] or [<a href="register.php">Register an account</a>]'; } |