summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-06-25 12:14:03 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-06-25 12:14:03 +0200
commitdd9dfc4461ba9e484f25c81e232f00ce1873e2f0 (patch)
tree5702f39b8fb4a1ddbe79b50adca403c819be1e2f /lib
parentf9dcb559e9693e7706184f4d48f20eee096b6c7f (diff)
downloadnextcloud-server-dd9dfc4461ba9e484f25c81e232f00ce1873e2f0.tar.gz
nextcloud-server-dd9dfc4461ba9e484f25c81e232f00ce1873e2f0.zip
show nice display name for remote shares if possible
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share/share.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 027c518f9f1..87000ca29a5 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_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']);