From 1344322654245acfb5c280509236e4cf32f6a7c2 Mon Sep 17 00:00:00 2001 From: AbangTor <63029179+abangtor@users.noreply.github.com> Date: Sun, 24 Jan 2021 18:12:17 +0800 Subject: [PATCH] fixed publishing of user properties to lookup-server Fix of the bug in the lookup_server_connector module to publish public user information to the lookup-server. As described in issue [#25290](https://github.com/nextcloud/server/issues/25290) Signed-off-by: AbangTor <63029179+abangtor@users.noreply.github.com> --- .../lib/BackgroundJobs/RetryJob.php | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php index 889fcfd627793..ec15c3c4cfb01 100644 --- a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php +++ b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php @@ -200,18 +200,24 @@ protected function getUserAccountData(IUser $user): array { $data = ['federationId' => $user->getCloudId()]; if (!empty($publicData)) { - $data['name'] = $publicData[IAccountManager::PROPERTY_DISPLAYNAME]['value'] ?? ''; - $data['email'] = $publicData[IAccountManager::PROPERTY_EMAIL]['value'] ?? ''; - $data['address'] = $publicData[IAccountManager::PROPERTY_ADDRESS]['value'] ?? ''; - $data['website'] = $publicData[IAccountManager::PROPERTY_WEBSITE]['value'] ?? ''; - $data['twitter'] = $publicData[IAccountManager::PROPERTY_TWITTER]['value'] ?? ''; - $data['phone'] = $publicData[IAccountManager::PROPERTY_PHONE]['value'] ?? ''; - $data['twitter_signature'] = $publicData[IAccountManager::PROPERTY_TWITTER]['signature'] ?? ''; - $data['website_signature'] = $publicData[IAccountManager::PROPERTY_WEBSITE]['signature'] ?? ''; - $data['verificationStatus'] = [ - IAccountManager::PROPERTY_WEBSITE => $publicData[IAccountManager::PROPERTY_WEBSITE]['verified'] ?? '', - IAccountManager::PROPERTY_TWITTER => $publicData[IAccountManager::PROPERTY_TWITTER]['verified'] ?? '', - ]; + $data['name'] = $publicData[IAccountManager::PROPERTY_DISPLAYNAME] ?? ''; + $data['email'] = $publicData[IAccountManager::PROPERTY_EMAIL] ?? ''; + $data['address'] = $publicData[IAccountManager::PROPERTY_ADDRESS] ?? ''; + $data['website'] = $publicData[IAccountManager::PROPERTY_WEBSITE] ?? ''; + $data['twitter'] = $publicData[IAccountManager::PROPERTY_TWITTER] ?? ''; + $data['phone'] = $publicData[IAccountManager::PROPERTY_PHONE] ?? ''; + + /** + /* @todo Signature and verification status are currently removed, + /* since those information are not provided by the Account + /* or AccountProperties class. + */ + //$data['twitter_signature'] = $publicData[IAccountManager::PROPERTY_TWITTER]['signature'] ?? ''; + //$data['website_signature'] = $publicData[IAccountManager::PROPERTY_WEBSITE]['signature'] ?? ''; + //$data['verificationStatus'] = [ + // IAccountManager::PROPERTY_WEBSITE => $publicData[IAccountManager::PROPERTY_WEBSITE]['verified'] ?? '', + // IAccountManager::PROPERTY_TWITTER => $publicData[IAccountManager::PROPERTY_TWITTER]['verified'] ?? '', + //]; } return $data;