aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-03 22:25:03 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-05 17:13:43 +0200
commit92a082d82364e86b43beed5911e22e65a3f0883f (patch)
treeb1ff95264b1a972bea01ceb9568ab8f61bea2659 /apps/user_ldap/lib
parentc3dcd70b91ecc38ee73b29966dafd960fc1e8576 (diff)
downloadnextcloud-server-92a082d82364e86b43beed5911e22e65a3f0883f.tar.gz
nextcloud-server-92a082d82364e86b43beed5911e22e65a3f0883f.zip
fix(ldap): avatar is not being fetched
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/User/User.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index dac8bf1cfbc..1c6efa77dc8 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -714,7 +714,7 @@ class User {
// use the checksum before modifications
$checksum = md5($this->image->data());
- if ($checksum === $this->config->getUserValue($this->uid, 'user_ldap', 'lastAvatarChecksum', '')) {
+ if ($checksum === $this->config->getUserValue($this->uid, 'user_ldap', 'lastAvatarChecksum', '') && $this->avatarExists()) {
return true;
}
@@ -728,6 +728,15 @@ class User {
return $isSet;
}
+ private function avatarExists(): bool {
+ try {
+ $currentAvatar = $this->avatarManager->getAvatar($this->uid);
+ return $currentAvatar->exists() && $currentAvatar->isCustomAvatar();
+ } catch (\Exception $e) {
+ return false;
+ }
+ }
+
/**
* @brief sets an image as Nextcloud avatar
* @return bool