From b2335b453e867fa6661cc059ae9f7535906d2e55 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Mon, 8 Apr 2024 17:04:33 -0700 Subject: [PATCH] fix: Fix avatar images Signed-off-by: Christopher Ng --- lib/private/Avatar/AvatarManager.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/private/Avatar/AvatarManager.php b/lib/private/Avatar/AvatarManager.php index 4125c8eb0a8..6bcfa175ba0 100644 --- a/lib/private/Avatar/AvatarManager.php +++ b/lib/private/Avatar/AvatarManager.php @@ -101,6 +101,9 @@ class AvatarManager implements IAvatarManager { /** * return a user specific instance of \OCP\IAvatar + * + * If the user is disabled a guest avatar will be returned + * * @see \OCP\IAvatar * @param string $userId the ownCloud user id * @return \OCP\IAvatar @@ -113,6 +116,10 @@ class AvatarManager implements IAvatarManager { throw new \Exception('user does not exist'); } + if (!$user->isEnabled()) { + return $this->getGuestAvatar($userId); + } + // sanitize userID - fixes casing issue (needed for the filesystem stuff that is done below) $userId = $user->getUID();