diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-24 09:40:20 -0600 |
---|---|---|
committer | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-24 09:40:20 -0600 |
commit | 7c3f2e348c015ea93563d866f89ec8cea9159ea0 (patch) | |
tree | b7b6b18cf9087f42300f621d15101628a8d214e4 /includes/Session.php | |
parent | 6c9369ad85f2fb3dc61234b54db7e7079cdc0c4e (diff) |
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.
Diffstat (limited to 'includes/Session.php')
-rw-r--r-- | includes/Session.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/includes/Session.php b/includes/Session.php index d97e7c5..7e17527 100644 --- a/includes/Session.php +++ b/includes/Session.php @@ -9,10 +9,8 @@ class Session session_start(); } - public static function get(): ?Session + public static function get() { - session_start(); - if (self::$instance == null) { self::$instance = new Session(); } @@ -25,7 +23,7 @@ class Session $_SESSION['signed_in'] = true; } - public function is_signed_in() + public function is_signed_in(): bool { return isset($_SESSION['signed_in']); } @@ -42,7 +40,7 @@ class Session $result = new User(); if (isset($_SESSION['user_id'])) { - $result->get_by_id($_GET['id'], $dbc); + $result->get_by_id($_SESSION['user_id']); } else { $result = null; } |