diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-08-30 19:57:01 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-08-30 19:57:01 +0200 |
commit | 2bd127c011846aad69731d1d63535a3d4f100af0 (patch) | |
tree | c05736a9ab1daa00047a3092887f972f701609e4 /includes/sys_auth.php | |
parent | 96f1d9fd541d0c5ef78151f8c69a89c41684b67a (diff) |
Use symfony session
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r-- | includes/sys_auth.php | 11 |
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 |