]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix preview for public links 5805/head
authorBjoern Schiessle <bjoern@schiessle.org>
Thu, 20 Jul 2017 09:24:52 +0000 (11:24 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Thu, 20 Jul 2017 09:31:31 +0000 (11:31 +0200)
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>
apps/dav/appinfo/v1/publicwebdav.php

index 3ef1c2e62a53218ed769533d1fab19e6708e98c8..37fcebe605c3062bd8a18ca63c652e1fd77d6d2c 100644 (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);