Fix shared folders

This commit is contained in:
Michael Gapczynski 2012-12-28 15:06:12 -05:00
parent b035626709
commit 8bdfb04056
3 changed files with 15 additions and 4 deletions

View file

@ -30,6 +30,10 @@ class Shared_Cache extends Cache {
private $files = array();
public function __construct($storage) {
}
/**
* @brief Get the source cache of a shared file or folder
* @param string Shared target file path
@ -41,8 +45,12 @@ class Shared_Cache extends Cache {
$source['path'] = '/'.$source['uid_owner'].'/'.$source['path'];
\OC\Files\Filesystem::initMountPoints($source['uid_owner']);
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source['path']);
$this->files[$target] = $internalPath;
return $storage->getCache();
if ($storage) {
$this->files[$target] = $internalPath;
$cache = $storage->getCache();
$this->numericId = $cache->getNumericStorageId();
return $cache;
}
}
return false;
}
@ -83,8 +91,11 @@ class Shared_Cache extends Cache {
if ($folder == '') {
return \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS);
} else {
return $this->getSourceCache($folder)->getFolderContents('/'.$this->files[$folder]);
if ($cache = $this->getSourceCache($folder)) {
return $cache->getFolderContents($this->files[$folder]);
}
}
return false;
}
/**

View file

@ -276,6 +276,7 @@ class Filesystem {
}
// Load personal mount points
$root = \OC_User::getHome($user);
self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
if (is_file($root.'/mount.php')) {
$mountConfig = include $root.'/mount.php';
if (isset($mountConfig['user'][$user])) {

View file

@ -51,7 +51,6 @@ class OC_Util {
mkdir( $userdirectory, 0755, true );
}
//jail the user into his "home" directory
\OC\Files\Filesystem::mount('\OC\Files\Storage\Local', array('datadir' => $user_root), $user);
\OC\Files\Filesystem::init($user_dir);
$quotaProxy=new OC_FileProxy_Quota();