summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r--includes/sys_auth.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/includes/sys_auth.php b/includes/sys_auth.php
index 36f0f935..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,12 +23,13 @@ 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