aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-11-10 14:36:15 +0100
committerRobin Appelman <robin@icewind.nl>2015-11-10 14:36:15 +0100
commitbbe2f5c2d57d57d5f89a76b63b9ba43bd0168169 (patch)
treecdd65f29a07f44762093636b9ab0010537c7d1c8 /lib/private/files/view.php
parentf77c6dbbed34fc1dcaaa3d35c7a9ecc499ce3e36 (diff)
parent20cad09f7fa7f81862fbfb538bed7ddd8c0923b3 (diff)
downloadnextcloud-server-bbe2f5c2d57d57d5f89a76b63b9ba43bd0168169.tar.gz
nextcloud-server-bbe2f5c2d57d57d5f89a76b63b9ba43bd0168169.zip
Merge pull request #20224 from owncloud/fileinfo-owner
Add getOwner to FileInfo
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 887b18530d7..7dd83588ec6 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -1250,7 +1250,8 @@ class View {
$data['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
}
- return new FileInfo($path, $storage, $internalPath, $data, $mount);
+ $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
+ return new FileInfo($path, $storage, $internalPath, $data, $mount, $owner);
}
/**
@@ -1316,7 +1317,8 @@ class View {
if (\OCP\Util::isSharingDisabledForUser()) {
$content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}
- $files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount);
+ $owner = \OC::$server->getUserManager()->get($storage->getOwner($content['path']));
+ $files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount, $owner);
}
//add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders
@@ -1385,7 +1387,8 @@ class View {
$rootEntry['permissions'] = $rootEntry['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}
- $files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount);
+ $owner = \OC::$server->getUserManager()->get($subStorage->getOwner(''));
+ $files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner);
}
}
}
@@ -1507,7 +1510,8 @@ class View {
$internalPath = $result['path'];
$path = $mountPoint . $result['path'];
$result['path'] = substr($mountPoint . $result['path'], $rootLength);
- $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount);
+ $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
+ $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner);
}
}
@@ -1525,7 +1529,8 @@ class View {
$internalPath = $result['path'];
$result['path'] = rtrim($relativeMountPoint . $result['path'], '/');
$path = rtrim($mountPoint . $internalPath, '/');
- $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount);
+ $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
+ $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner);
}
}
}
@@ -1666,6 +1671,7 @@ class View {
$mount = $this->getMount($path);
$storage = $mount->getStorage();
$internalPath = $mount->getInternalPath($this->getAbsolutePath($path));
+ $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
return new FileInfo(
$this->getAbsolutePath($path),
$storage,
@@ -1680,7 +1686,8 @@ class View {
'encrypted' => false,
'permissions' => \OCP\Constants::PERMISSION_ALL
],
- $mount
+ $mount,
+ $owner
);
}