summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-30 19:57:01 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-30 19:57:01 +0200
commit2bd127c011846aad69731d1d63535a3d4f100af0 (patch)
treec05736a9ab1daa00047a3092887f972f701609e4 /includes/sys_auth.php
parent96f1d9fd541d0c5ef78151f8c69a89c41684b67a (diff)
Use symfony session
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