diff --git a/apps/files_external/lib/Migration/DummyUserSession.php b/apps/files_external/lib/Migration/DummyUserSession.php index ce987b3c575f8..a5956ed7bc837 100644 --- a/apps/files_external/lib/Migration/DummyUserSession.php +++ b/apps/files_external/lib/Migration/DummyUserSession.php @@ -28,7 +28,6 @@ use OCP\IUserSession; class DummyUserSession implements IUserSession { - private ?IUser $user = null; public function login($uid, $password) { diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index 238de2a888fa9..768237f96c99f 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -39,8 +39,8 @@ use OC\User\LoginException; use OCP\EventDispatcher\IEventDispatcher; use OCP\ILogger; +use OCP\ISession; use OCP\IUserManager; -use OCP\IUserSession; use OCP\Server; use OCP\User\Events\BeforeUserLoggedInEvent; use OCP\User\Events\UserLoggedInEvent; @@ -351,7 +351,7 @@ public static function isAdminUser($uid) { * @return string|false uid or false */ public static function getUser() { - $uid = Server::get(IUserSession::class)->getUser()?->getUID(); + $uid = Server::get(ISession::class)?->get('user_id'); if (!is_null($uid) && self::$incognitoMode === false) { return $uid; } else {