Fix shared storage working with user backend defined data directories
This commit is contained in:
parent
3828d86191
commit
8d490b9880
2 changed files with 3 additions and 10 deletions
|
@ -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;
|
||||
|
|
10
lib/util.php
10
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;
|
||||
|
|
Loading…
Reference in a new issue