diff options
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r-- | includes/sys_auth.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/includes/sys_auth.php b/includes/sys_auth.php index e0ed67e5..4242261b 100644 --- a/includes/sys_auth.php +++ b/includes/sys_auth.php @@ -10,8 +10,10 @@ function load_auth() global $user, $privileges; $user = null; - if (isset($_SESSION['uid'])) { - $user = DB::selectOne('SELECT * FROM `User` WHERE `UID`=? LIMIT 1', [$_SESSION['uid']]); + $session = session(); + + if ($session->has('uid')) { + $user = DB::selectOne('SELECT * FROM `User` WHERE `UID`=? LIMIT 1', [$session->get('uid')]); if (!empty($user)) { // User ist eingeloggt, Datensatz zur Verfügung stellen und Timestamp updaten DB::update(' @@ -21,16 +23,17 @@ function load_auth() LIMIT 1 ', [ time(), - $_SESSION['uid'], + $session->get('uid'), ]); $privileges = privileges_for_user($user['UID']); return; } - unset($_SESSION['uid']); + + $session->remove('uid'); } // guest privileges - $privileges = privileges_for_group(-1); + $privileges = privileges_for_group(-10); } /** |