aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-08-08 15:00:47 +0200
committerRobin Appelman <icewind@owncloud.com>2014-08-08 15:48:59 +0200
commit07d5725de2aa597f41bfc25f676af935b60a52be (patch)
tree757acc2f7cebd91f279fa0b3ea45f08e9121485f
parentfa260b1649e200a0e6a4d3d921bcf22c414d4824 (diff)
downloadnextcloud-server-07d5725de2aa597f41bfc25f676af935b60a52be.tar.gz
nextcloud-server-07d5725de2aa597f41bfc25f676af935b60a52be.zip
Fix trashbin when deleting a file over an external share
-rw-r--r--apps/files_sharing/publicwebdav.php1
-rw-r--r--apps/files_trashbin/lib/trashbin.php6
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php
index 03e43967a40..764ec7b5126 100644
--- a/apps/files_sharing/publicwebdav.php
+++ b/apps/files_sharing/publicwebdav.php
@@ -54,7 +54,6 @@ $server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $
$ownerView = \OC\Files\Filesystem::getView();
$path = $ownerView->getPath($fileId);
-
$view = new \OC\Files\View($ownerView->getAbsolutePath($path));
$rootInfo = $view->getFileInfo('');
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index ee3969323cf..feb150ddc9a 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -22,6 +22,8 @@
namespace OCA\Files_Trashbin;
+use OC\Files\Filesystem;
+
class Trashbin {
// how long do we keep files in the trash bin if no other value is defined in the config file (unit: days)
@@ -99,7 +101,9 @@ class Trashbin {
* @param string $file_path path to the deleted file/directory relative to the files root directory
*/
public static function move2trash($file_path) {
- $user = \OCP\User::getUser();
+ // get the user for which the filesystem is setup
+ $root = Filesystem::getRoot();
+ list(, $user) = explode('/', $root);
$size = 0;
list($owner, $ownerPath) = self::getUidAndFilename($file_path);
self::setUpTrash($user);