fix preview for public links

in case a user is already logged in on the same server from
which the public link comes from, we need to setup the owners
file system in order to show the preview

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2017-07-20 11:24:52 +02:00
parent 5e468c0bba
commit ae8a3ce085
No known key found for this signature in database
GPG key ID: 2378A753E2BF04F6

View file

@ -79,10 +79,12 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
});
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
OC_Util::tearDownFS();
OC_Util::setupFS($owner);
$ownerView = \OC\Files\Filesystem::getView();
$ownerView = new \OC\Files\View('/'. $owner . '/files');
$path = $ownerView->getPath($fileId);
$fileInfo = $ownerView->getFileInfo($path);
$linkCheckPlugin->setFileInfo($fileInfo);