diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-05-28 01:04:09 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-05-28 01:04:09 +0200 |
commit | 44f9af5a7fb6f0f9846bfb36ff99f9bf8aee5985 (patch) | |
tree | 542dda23ae155538850908d14536f3cc3a27aa6c /lib/user.php | |
parent | 76d13120eaf0bb6ed5661baa898b13cc6d35b111 (diff) | |
download | nextcloud-server-44f9af5a7fb6f0f9846bfb36ff99f9bf8aee5985.tar.gz nextcloud-server-44f9af5a7fb6f0f9846bfb36ff99f9bf8aee5985.zip |
Use the new session wrapper
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/user.php b/lib/user.php index 26fe73f8bfe..1dde87a1339 100644 --- a/lib/user.php +++ b/lib/user.php @@ -264,7 +264,7 @@ class OC_User { * @brief Sets user id for session and triggers emit */ public static function setUserId($uid) { - $_SESSION['user_id'] = $uid; + \OC::$session->set('user_id', $uid); } /** @@ -285,7 +285,7 @@ class OC_User { $result = true; } if (OC_User::getUser() === $uid) { - $_SESSION['display_name'] = $displayName; + \OC::$session->set('display_name', $displayName); } return $result; } @@ -328,10 +328,10 @@ class OC_User { * Checks if the user is logged in */ public static function isLoggedIn() { - if( isset($_SESSION['user_id']) AND $_SESSION['user_id']) { + if( \OC::$session->get('user_id')) { OC_App::loadApps(array('authentication')); self::setupBackends(); - if (self::userExists($_SESSION['user_id']) ) { + if (self::userExists(\OC::$session->get('user_id')) ) { return true; } } @@ -356,8 +356,8 @@ class OC_User { * @return string uid or false */ public static function getUser() { - if( isset($_SESSION['user_id']) AND $_SESSION['user_id'] ) { - return $_SESSION['user_id']; + if( \OC::$session->get('user_id') ) { + return \OC::$session->get('user_id'); } else{ return false; @@ -371,8 +371,8 @@ class OC_User { public static function getDisplayName($user=null) { if ( $user ) { return self::determineDisplayName($user); - } else if( isset($_SESSION['display_name']) AND $_SESSION['display_name'] ) { - return $_SESSION['display_name']; + } else if( \OC::$session->get('display_name') ) { + return \OC::$session->get('display_name'); } else{ return false; |