summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-29 14:36:51 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-29 14:39:13 -0400
commit8d490b9880368a6fd5fcd65964e1f23e6ed350eb (patch)
treeff0eb8a6def1de765f926a355c2780979750c282
parent3828d86191e7a0ecf8acbdddbb703352983178e1 (diff)
downloadnextcloud-server-8d490b9880368a6fd5fcd65964e1f23e6ed350eb.tar.gz
nextcloud-server-8d490b9880368a6fd5fcd65964e1f23e6ed350eb.zip
Fix shared storage working with user backend defined data directories
-rw-r--r--apps/files_sharing/lib/sharedstorage.php3
-rwxr-xr-xlib/util.php10
2 files changed, 3 insertions, 10 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index df5d4d20aed..6a2905b52c9 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -30,7 +30,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
public function __construct($arguments) {
$this->sharedFolder = $arguments['sharedFolder'];
- OC_Util::setupFS4all();
}
/**
@@ -78,6 +77,8 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
private function getSourcePath($target) {
$file = $this->getFile($target);
if (isset($file['path'])) {
+ $uid = substr($file['path'], 1, strpos($file['path'], '/', 1) - 1);
+ OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => OC_User::getHome($uid)), $uid);
return $file['path'];
}
return false;
diff --git a/lib/util.php b/lib/util.php
index 24f80b93896..b77d6cb1b65 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -35,13 +35,11 @@ class OC_Util {
$user_dir = '/'.$user.'/files';
$user_root = OC_User::getHome($user);
$userdirectory = $user_root . '/files';
- OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>$user_root), $user);
if( !is_dir( $userdirectory )){
mkdir( $userdirectory, 0755, true );
}
- OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>$user_root), $user);
-
//jail the user into his "home" directory
+ OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => $user_root), $user);
OC_Filesystem::init($user_dir);
$quotaProxy=new OC_FileProxy_Quota();
OC_FileProxy::register($quotaProxy);
@@ -59,12 +57,6 @@ class OC_Util {
}
}
- public static function setupFS4all(){
- foreach(OC_User::getUsers() as $user){
- OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>OC_User::getHome($singleuser)), $user);
- }
- }
-
public static function tearDownFS(){
OC_Filesystem::tearDown();
self::$fsSetup=false;