aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-05 15:45:59 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-09 12:34:35 +0200
commit41d23541916096170de256b4d1eeb4a853afd0af (patch)
treeb8e9a1e77d53ed2a8ea7d1e5d5905e5713e64106 /lib
parent3239d1099c88b78d57a14e032f15062277aeaee3 (diff)
downloadnextcloud-server-41d23541916096170de256b4d1eeb4a853afd0af.tar.gz
nextcloud-server-41d23541916096170de256b4d1eeb4a853afd0af.zip
Save the permissions in the filecache if it's not saved yet
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index d42f6cbf9fe..afccdf9f733 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -861,8 +861,12 @@ class View {
}
if ($data and isset($data['fileid'])) {
+ if ($data['permissions'] === 0) {
+ $data['permissions'] = $storage->getPermissions($data['path']);
+ $cache->update($data['fileid'], array('permissions' => $data['permissions']));
+ }
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
- //add the sizes of other mountpoints to the folder
+ //add the sizes of other mount points to the folder
$extOnly = ($includeMountPoints === 'ext');
$mountPoints = Filesystem::getMountPoints($path);
foreach ($mountPoints as $mountPoint) {
@@ -917,21 +921,17 @@ class View {
}
$folderId = $cache->getId($internalPath);
+ /**
+ * @var \OC\Files\FileInfo[] $files
+ */
$files = array();
$contents = $cache->getFolderContents($internalPath, $folderId); //TODO: mimetype_filter
foreach ($contents as $content) {
- $files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
- }
-
- $ids = array();
- foreach ($files as $i => $file) {
- $files[$i]['type'] = $file['mimetype'] === 'httpd/unix-directory' ? 'dir' : 'file';
- $ids[] = $file['fileid'];
-
- if (!isset($permissions[$file['fileid']])) {
- $permissions[$file['fileid']] = $storage->getPermissions($file['path']);
+ if ($content['permissions'] === 0) {
+ $content['permissions'] = $storage->getPermissions($content['path']);
+ $cache->update($content['fileid'], array('permissions' => $content['permissions']));
}
- $files[$i]['permissions'] = $permissions[$file['fileid']];
+ $files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
}
//add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders