diff options
Diffstat (limited to 'lib/private/legacy/OC_User.php')
-rw-r--r-- | lib/private/legacy/OC_User.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index 3d958814988..1174c492fef 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -39,6 +39,7 @@ use OC\Authentication\Token\IProvider; use OC\User\LoginException; use OCP\EventDispatcher\IEventDispatcher; use OCP\IGroupManager; +use OCP\ISession; use OCP\IUser; use OCP\IUserManager; use OCP\Server; @@ -349,7 +350,7 @@ class OC_User { * @return string|false uid or false */ public static function getUser() { - $uid = \OC::$server->getSession() ? \OC::$server->getSession()->get('user_id') : null; + $uid = Server::get(ISession::class)?->get('user_id'); if (!is_null($uid) && self::$incognitoMode === false) { return $uid; } else { |