From 7c3f2e348c015ea93563d866f89ec8cea9159ea0 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 24 Apr 2021 09:40:20 -0600 Subject: Refactoring part 2 Starting to move some functionality such as the session and database connection into singleton classes to manage them. Functions for modifying posts and threads are being put in one place as well. --- includes/templates/header.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'includes/templates') 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 @@ [Create a thread] ' . $_SESSION['user_name'] . '\'s Profile] [Log out]'; + include_once './includes/Session.php'; + include_once './includes/model/User.php'; + + if (Session::get()->is_signed_in()) { + $user = Session::get()->get_current_user(); + echo '[' . $user->name . '\'s Profile] [Log out]'; } else { echo '[Sign in] or [Register an account]'; } -- cgit v1.2.3