From 2aa653a22438b9a8e4ad5b9f3815199b2e9bda48 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 22 Mar 2024 01:04:48 +0100 Subject: [PATCH] fix(logging): Restore the option to log with debug level Signed-off-by: Joas Schilling --- apps/files_external/lib/Migration/DummyUserSession.php | 1 - lib/private/legacy/OC_User.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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 {