aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-18 13:51:24 +0100
committerGitHub <noreply@github.com>2016-11-18 13:51:24 +0100
commit6c11c54434b29bb9f7f07ba9a8070ed8308bc5a4 (patch)
tree21531c65f84e843da271e7df92fafa28bfaba830
parentc241539a21a38d5710c160ae02794ffb26008853 (diff)
parentdbd7f6dea61982f34d3005ac2ad63f0cd3ff9be8 (diff)
downloadnextcloud-server-6c11c54434b29bb9f7f07ba9a8070ed8308bc5a4.tar.gz
nextcloud-server-6c11c54434b29bb9f7f07ba9a8070ed8308bc5a4.zip
Merge pull request #2196 from nextcloud/cache-owner-displayname
cache the displayname of the share owner
-rw-r--r--apps/files_sharing/lib/Cache.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 49765a7aab5..bc10ddbd94f 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -49,6 +49,8 @@ class Cache extends CacheJail {
private $rootUnchanged = true;
+ private $ownerDisplayName;
+
/**
* @param \OCA\Files_Sharing\SharedStorage $storage
* @param ICacheEntry $sourceRootInfo
@@ -114,13 +116,20 @@ class Cache extends CacheJail {
$entry['permissions'] = $sharePermissions;
}
$entry['uid_owner'] = $this->storage->getOwner($path);
- $entry['displayname_owner'] = \OC_User::getDisplayName($entry['uid_owner']);
+ $entry['displayname_owner'] = $this->getOwnerDisplayName();
if ($path === '') {
$entry['is_share_mount_point'] = true;
}
return $entry;
}
+ private function getOwnerDisplayName() {
+ if (!$this->ownerDisplayName) {
+ $this->ownerDisplayName = \OC_User::getDisplayName($this->storage->getOwner(''));
+ }
+ return $this->ownerDisplayName;
+ }
+
/**
* remove all entries for files that are stored on the storage from the cache
*/