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)
This commit is contained in:
Björn Schießle 2012-10-22 14:52:59 +02:00
parent 296884b24a
commit 366aeb7228
2 changed files with 6 additions and 3 deletions

View File

@ -254,14 +254,17 @@ class OC_Filesystem{
} }
} }
static public function init($root) { static public function init($root, $user = '') {
if(self::$defaultInstance) { if(self::$defaultInstance) {
return false; return false;
} }
self::$defaultInstance=new OC_FilesystemView($root); self::$defaultInstance=new OC_FilesystemView($root);
//load custom mount config //load custom mount config
self::loadSystemMountPoints(OC_User::getUser()); if (!isset($user)) {
$user = OC_User::getUser();
}
self::loadSystemMountPoints($user);
self::$loaded=true; self::$loaded=true;
} }

View File

@ -47,7 +47,7 @@ class OC_Util {
} }
//jail the user into his "home" directory //jail the user into his "home" directory
OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => $user_root), $user); 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(); $quotaProxy=new OC_FileProxy_Quota();
$fileOperationProxy = new OC_FileProxy_FileOperations(); $fileOperationProxy = new OC_FileProxy_FileOperations();
OC_FileProxy::register($quotaProxy); OC_FileProxy::register($quotaProxy);