From 0caf43ff07dec5cfb4263dccd5659f4f414b43dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 10 Oct 2023 08:19:41 +0200 Subject: [PATCH] fix: Implement IGetDisplayNameBackend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/UserBackend.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/UserBackend.php b/lib/UserBackend.php index b5b0a6a3d..744cc3ca0 100644 --- a/lib/UserBackend.php +++ b/lib/UserBackend.php @@ -36,10 +36,11 @@ use OCP\IUserManager; use OCP\IUserSession; use OCP\Server; +use OCP\User\Backend\IGetDisplayNameBackend; use OCP\User\Events\UserChangedEvent; use OCP\UserInterface; -class UserBackend implements IApacheBackend, UserInterface, IUserBackend { +class UserBackend implements IApacheBackend, UserInterface, IUserBackend, IGetDisplayNameBackend { /** @var IConfig */ private $config; /** @var IURLGenerator */ @@ -308,9 +309,9 @@ public function setDisplayName($uid, $displayName) { * * @param string $uid user ID of the user * @return string display name - * @since 4.5.0 + * @since 14.0.0 */ - public function getDisplayName($uid) { + public function getDisplayName($uid): string { if ($backend = $this->getActualUserBackend($uid)) { return $backend->getDisplayName($uid); } else { @@ -328,7 +329,7 @@ public function getDisplayName($uid) { } } - return false; + return $uid; } /**