[Pkg-owncloud-commits] [owncloud] 213/239: fix public preview creation if a user ios logged in
David Prévot
taffit at moszumanska.debian.org
Fri Nov 29 01:32:40 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit aee7781f229e0e18bcba92099781d5a0fef865e1
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Wed Nov 27 18:35:52 2013 +0100
fix public preview creation if a user ios logged in
---
apps/files_sharing/ajax/publicpreview.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index 41a1c17..8c3085f 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'];
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list