summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-09-11 17:52:55 +0200
committerGitHub <noreply@github.com>2017-09-11 17:52:55 +0200
commit359160613027a480620e22deef19ff883eaaeb21 (patch)
tree310600aaa23404f0cd7d3e198bacdbc93645da32 /includes/sys_auth.php
parent581b81f1b25dc6b6f0a3b34810c293738fd40217 (diff)
parent0a20883aa862779b48fd2a297456c2db04cffb95 (diff)
Merge pull request #344 from MyIgel/master
Prepared routing, added symfony http Closes #336 and closes #337
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r--includes/sys_auth.php13
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);
}
/**