diff options
author | max-nextcloud <max@nextcloud.com> | 2023-08-17 23:10:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 23:10:38 +0200 |
commit | 4b7aa651927ae088f277261162f24bd39438ea92 (patch) | |
tree | f5f7c56717a409f55b0eb2db6df7e6b851450625 | |
parent | a98748e519ef4df1546ef1242953f0a367b40132 (diff) | |
parent | 99a4a9cd09abe78a9a0b35e6c7ede472b80fdbf9 (diff) | |
download | nextcloud-server-4b7aa651927ae088f277261162f24bd39438ea92.tar.gz nextcloud-server-4b7aa651927ae088f277261162f24bd39438ea92.zip |
Merge pull request #39770 from nextcloud/fix/always-use-displayname-from-correct-backend
fix: always use display name from correct backend
-rw-r--r-- | lib/private/Accounts/AccountManager.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 95199d8380c..9865438161b 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -62,6 +62,7 @@ use OCP\L10N\IFactory; use OCP\Mail\IMailer; use OCP\Security\ICrypto; use OCP\Security\VerificationToken\IVerificationToken; +use OCP\User\Backend\IGetDisplayNameBackend; use OCP\Util; use Psr\Log\LoggerInterface; use function array_flip; @@ -744,6 +745,10 @@ class AccountManager implements IAccountManager { return $cached; } $account = $this->parseAccountData($user, $this->getUser($user)); + if ($user->getBackend() instanceof IGetDisplayNameBackend) { + $property = $account->getProperty(self::PROPERTY_DISPLAYNAME); + $account->setProperty(self::PROPERTY_DISPLAYNAME, $user->getDisplayName(), $property->getScope(), $property->getVerified()); + } $this->internalCache->set($user->getUID(), $account); return $account; } |