summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-04-09 11:18:07 +0200
committerGitHub <noreply@github.com>2024-04-09 11:18:07 +0200
commitfe643bb4730118981a2a3d263c0997c41a93f39b (patch)
tree3b00e1ba584c95874ba8d0cde11664592cb0f132 /lib
parent17dce741977fc9e84cbc6cad78322599de2253ad (diff)
parenteb063928f1645517aacc710f78088f1a7724af88 (diff)
downloadnextcloud-server-fe643bb4730118981a2a3d263c0997c41a93f39b.tar.gz
nextcloud-server-fe643bb4730118981a2a3d263c0997c41a93f39b.zip
Merge pull request #44738 from nextcloud/backport/stable28/44736
[stable28] fix: Fix avatar images
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Avatar/AvatarManager.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/Avatar/AvatarManager.php b/lib/private/Avatar/AvatarManager.php
index 1e137fa8715..69a35556a8c 100644
--- a/lib/private/Avatar/AvatarManager.php
+++ b/lib/private/Avatar/AvatarManager.php
@@ -69,6 +69,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
* @throws \Exception In case the username is potentially dangerous
@@ -80,6 +83,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();