make sharing work with the new mouting mechanism
This commit is contained in:
parent
28ab39073a
commit
b975f11514
|
@ -22,6 +22,11 @@
|
|||
|
||||
require_once( 'lib_share.php' );
|
||||
|
||||
if (!OC_Filesystem::is_dir('/Shared')) {
|
||||
OC_Filesystem::mkdir('/Shared');
|
||||
}
|
||||
OC_Filesystem::mount('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'),'/'.OC_User::getUser().'/files/Shared/');
|
||||
|
||||
/**
|
||||
* Convert target path to source path and pass the function call to the correct storage provider
|
||||
*/
|
||||
|
@ -32,13 +37,6 @@ class OC_Filestorage_Shared extends OC_Filestorage {
|
|||
|
||||
public function __construct($arguments) {
|
||||
$this->datadir = $arguments['datadir'];
|
||||
if (OC_Share::getItemsInFolder($this->datadir)) {
|
||||
if (!OC_Filesystem::is_dir($this->datadir)) {
|
||||
OC_Filesystem::mkdir($this->datadir);
|
||||
}
|
||||
} else if (OC_Filesystem::is_dir($this->datadir)) {
|
||||
OC_Filesystem::rmdir($this->datadir);
|
||||
}
|
||||
$this->datadir .= "/";
|
||||
}
|
||||
|
||||
|
|
14
lib/base.php
14
lib/base.php
|
@ -154,13 +154,6 @@ class OC{
|
|||
OC_User::useBackend( OC_Config::getValue( "userbackend", "database" ));
|
||||
OC_Group::setBackend( OC_Config::getValue( "groupbackend", "database" ));
|
||||
|
||||
// Load Apps
|
||||
// This includes plugins for users and filesystems as well
|
||||
global $RUNTIME_NOAPPS;
|
||||
if(!$RUNTIME_NOAPPS ){
|
||||
OC_App::loadApps();
|
||||
}
|
||||
|
||||
// Was in required file ... put it here
|
||||
OC_Filesystem::registerStorageType('local','OC_Filestorage_Local',array('datadir'=>'string'));
|
||||
|
||||
|
@ -170,6 +163,13 @@ class OC{
|
|||
OC_Util::setupFS();
|
||||
}
|
||||
|
||||
// Load Apps
|
||||
// This includes plugins for users and filesystems as well
|
||||
global $RUNTIME_NOAPPS;
|
||||
if(!$RUNTIME_NOAPPS ){
|
||||
OC_App::loadApps();
|
||||
}
|
||||
|
||||
// Last part: connect some hooks
|
||||
OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Connector_Sabre_Principal', 'addPrincipal');
|
||||
OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Connector_Sabre_Principal', 'deletePrincipal');
|
||||
|
|
|
@ -168,7 +168,7 @@ class OC_Filesystem{
|
|||
if(substr($mountpoint,0,1)!=='/'){
|
||||
$mountpoint='/'.$mountpoint;
|
||||
}
|
||||
self::$mounts[self::$fakeRoot.$mountpoint]=array('type'=>$type,'arguments'=>$arguments);
|
||||
self::$mounts[$mountpoint]=array('type'=>$type,'arguments'=>$arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,9 +39,6 @@ class OC_Util {
|
|||
//first set up the local "root" storage
|
||||
OC_Filesystem::mount('local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT),'/');
|
||||
|
||||
// TODO add this storage provider in a proper way
|
||||
OC_Filesystem::mount('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'),'/'.OC_User::getUser().'/files/Shared/');
|
||||
|
||||
OC::$CONFIG_DATADIRECTORY = $CONFIG_DATADIRECTORY_ROOT."/$user/$root";
|
||||
if( !is_dir( OC::$CONFIG_DATADIRECTORY )){
|
||||
mkdir( OC::$CONFIG_DATADIRECTORY, 0755, true );
|
||||
|
|
Loading…
Reference in New Issue