summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2012-10-22 14:52:59 +0200
committerBjörn Schießle <schiessle@owncloud.com>2012-10-22 14:55:53 +0200
commitd68b89cae43beca3a3ae8531395d125ea67cd053 (patch)
treeee761372991f9573a3ca89e95f860324d9c5a180
parentd8e945466da8aa39b7dfe849b305d5b1b33531d2 (diff)
downloadnextcloud-server-d68b89cae43beca3a3ae8531395d125ea67cd053.tar.gz
nextcloud-server-d68b89cae43beca3a3ae8531395d125ea67cd053.zip
add parameter to specify user for which OC_Filesystem should be initialized.
(needed to share files via public links where no user is logged in)
-rw-r--r--lib/filesystem.php7
-rwxr-xr-xlib/util.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 8b44ab6e6c6..00682573dd9 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -254,14 +254,17 @@ class OC_Filesystem{
}
}
- static public function init($root) {
+ static public function init($root, $user = '') {
if(self::$defaultInstance) {
return false;
}
self::$defaultInstance=new OC_FilesystemView($root);
//load custom mount config
- self::loadSystemMountPoints(OC_User::getUser());
+ if (!isset($user)) {
+ $user = OC_User::getUser();
+ }
+ self::loadSystemMountPoints($user);
self::$loaded=true;
}
diff --git a/lib/util.php b/lib/util.php
index eb0e5e8ec40..a847c02872e 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -47,7 +47,7 @@ class OC_Util {
}
//jail the user into his "home" directory
OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => $user_root), $user);
- OC_Filesystem::init($user_dir);
+ OC_Filesystem::init($user_dir, $user);
$quotaProxy=new OC_FileProxy_Quota();
$fileOperationProxy = new OC_FileProxy_FileOperations();
OC_FileProxy::register($quotaProxy);