diff options
author | Björn Schießle <bjoern@schiessle.org> | 2013-11-27 11:05:27 -0800 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2013-11-27 11:05:27 -0800 |
commit | 5295993144bf7a67fdcd48c9f8e99e336fd1293e (patch) | |
tree | 630eb31c7c32c64bd8f59272ea6c2a563b11e908 /apps | |
parent | 34a8c3c4cd7841e3a8b1730c580003736277e2d7 (diff) | |
parent | aee7781f229e0e18bcba92099781d5a0fef865e1 (diff) | |
download | nextcloud-server-5295993144bf7a67fdcd48c9f8e99e336fd1293e.tar.gz nextcloud-server-5295993144bf7a67fdcd48c9f8e99e336fd1293e.zip |
Merge pull request #6088 from owncloud/fix_public_previews
fix public preview creation if a user is logged in
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/ajax/publicpreview.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 41a1c178a48..8c3085f1589 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -9,6 +9,8 @@ if(!\OC_App::isEnabled('files_sharing')){ exit; } +\OC_User::setIncognitoMode(true); + $file = array_key_exists('file', $_GET) ? (string) urldecode($_GET['file']) : ''; $maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '36'; $maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '36'; @@ -36,10 +38,12 @@ if(!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) { $userId = $linkedItem['uid_owner']; \OC_Util::setupFS($userId); +\OC\Files\Filesystem::initMountPoints($userId); +$view = new \OC\Files\View('/' . $userId . '/files'); $pathId = $linkedItem['file_source']; -$path = \OC\Files\Filesystem::getPath($pathId); -$pathInfo = \OC\Files\Filesystem::getFileInfo($path); +$path = $view->getPath($pathId); +$pathInfo = $view->getFileInfo($path); $sharedFile = null; if($linkedItem['item_type'] === 'folder') { @@ -54,7 +58,7 @@ if($linkedItem['item_type'] === 'folder') { if($linkedItem['item_type'] === 'file') { $parent = $pathInfo['parent']; - $path = \OC\Files\Filesystem::getPath($parent); + $path = $view->getPath($parent); $sharedFile = $pathInfo['name']; } |