Browse Source

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>
pull/5803/head
Bjoern Schiessle 8 years ago
parent
commit
ae8a3ce085
No known key found for this signature in database GPG Key ID: 2378A753E2BF04F6
  1. 4
      apps/dav/appinfo/v1/publicwebdav.php

4
apps/dav/appinfo/v1/publicwebdav.php

@ -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);

Loading…
Cancel
Save