aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Avatar
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2024-04-08 17:04:33 -0700
committerChristopher Ng <chrng8@gmail.com>2024-04-08 17:09:26 -0700
commitdbb6213c1a79d75d6a06116cf836ff0cd4684f36 (patch)
tree7406726168d8fdba7d8cf343d273943c796c1a4b /lib/private/Avatar
parentf89dabb828e782af51992633c9fd57b593a2d5cb (diff)
downloadnextcloud-server-dbb6213c1a79d75d6a06116cf836ff0cd4684f36.tar.gz
nextcloud-server-dbb6213c1a79d75d6a06116cf836ff0cd4684f36.zip
fix: Fix avatar images
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'lib/private/Avatar')
-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();