summaryrefslogtreecommitdiffstats
path: root/lib/private/share
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-06-26 10:53:02 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-06-26 10:53:02 +0200
commit6c3a4282e5f24b5914b8d1afa869d9595fb14261 (patch)
treec7db4bcb8bdedae97c4377003fa011ac16c45a0b /lib/private/share
parent569157d529ccd15d8eb3c77e0c283c14951bfe3a (diff)
parenta288d0eea36331703bf1d6e48b4bbe3e0b98e4b2 (diff)
downloadnextcloud-server-6c3a4282e5f24b5914b8d1afa869d9595fb14261.tar.gz
nextcloud-server-6c3a4282e5f24b5914b8d1afa869d9595fb14261.zip
Merge pull request #17165 from owncloud/federated_cloud_sharing_search_address_book
Search address book for federated cloud id
Diffstat (limited to 'lib/private/share')
-rw-r--r--lib/private/share/share.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 954071fdd6c..b2ac9ee6a42 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -1703,11 +1703,20 @@ class Share extends Constants {
$row['permissions'] &= ~\OCP\Constants::PERMISSION_SHARE;
}
// Add display names to result
+ $row['share_with_displayname'] = $row['share_with'];
if ( isset($row['share_with']) && $row['share_with'] != '' &&
- isset($row['share_with']) && $row['share_type'] === self::SHARE_TYPE_USER) {
+ $row['share_type'] === self::SHARE_TYPE_USER) {
$row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']);
- } else {
- $row['share_with_displayname'] = $row['share_with'];
+ } else if(isset($row['share_with']) && $row['share_with'] != '' &&
+ $row['share_type'] === self::SHARE_TYPE_REMOTE) {
+ $addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD']);
+ foreach ($addressBookEntries as $entry) {
+ foreach ($entry['CLOUD'] as $cloudID) {
+ if ($cloudID === $row['share_with']) {
+ $row['share_with_displayname'] = $entry['FN'];
+ }
+ }
+ }
}
if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {
$row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);