summaryrefslogtreecommitdiffstats
path: root/inc/user.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2021-05-04 17:32:26 +0200
committerSimon Rettberg2021-05-11 14:50:11 +0200
commit1e8329986ef4d06a9bb7550e24f4dacc7715fb5b (patch)
tree67e13b41650992d2266d42c88b91489a65840eae /inc/user.inc.php
parent[systemstatus] Fix displaying VM store usage if using internal storage (diff)
downloadslx-admin-1e8329986ef4d06a9bb7550e24f4dacc7715fb5b.tar.gz
slx-admin-1e8329986ef4d06a9bb7550e24f4dacc7715fb5b.tar.xz
slx-admin-1e8329986ef4d06a9bb7550e24f4dacc7715fb5b.zip
[main+Session] Move session from /tmp/ to session table
Diffstat (limited to 'inc/user.inc.php')
-rw-r--r--inc/user.inc.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/inc/user.inc.php b/inc/user.inc.php
index 2ad256af..46cc6012 100644
--- a/inc/user.inc.php
+++ b/inc/user.inc.php
@@ -113,8 +113,8 @@ class User
if (self::isLoggedIn())
return true;
if (Session::load()) {
- $uid = Session::get('uid');
- if ($uid === false || $uid < 1)
+ $uid = Session::getUserId();
+ if ($uid < 1)
self::logout();
self::$user = Database::queryFirst('SELECT * FROM user WHERE userid = :uid LIMIT 1', array(':uid' => $uid));
if (self::$user === false)
@@ -149,8 +149,7 @@ class User
return false;
if (!Crypto::verify($pass, $ret['passwd']))
return false;
- Session::create($ret['passwd']);
- Session::set('uid', $ret['userid']);
+ Session::create($ret['passwd'], $ret['userid'], false);
Session::set('token', md5($ret['passwd'] . ','
. rand() . ','
. time() . ','
@@ -159,8 +158,7 @@ class User
. rand() . ','
. $_SERVER['REMOTE_PORT'] . ','
. rand() . ','
- . $_SERVER['HTTP_USER_AGENT']));
- Session::save();
+ . $_SERVER['HTTP_USER_AGENT']), false);
return true;
}