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:
parent
5e468c0bba
commit
ae8a3ce085
|
@ -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…
Reference in New Issue