summaryrefslogtreecommitdiffstats
path: root/inc/user.inc.php
diff options
context:
space:
mode:
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;
}