aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-10-18 21:19:13 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-10-18 21:19:13 +0200
commitb975f1151451785f8350a12bf63d8fd63f0d04b4 (patch)
treeb75af170f28214636ebee26dfe2235e3dbaff338
parent28ab39073a8ea942a7c299dc41ddf6023dd093de (diff)
downloadnextcloud-server-b975f1151451785f8350a12bf63d8fd63f0d04b4.tar.gz
nextcloud-server-b975f1151451785f8350a12bf63d8fd63f0d04b4.zip
make sharing work with the new mouting mechanism
-rw-r--r--apps/files_sharing/sharedstorage.php12
-rw-r--r--lib/base.php14
-rw-r--r--lib/filesystem.php2
-rw-r--r--lib/util.php3
4 files changed, 13 insertions, 18 deletions
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 53f25b60e91..faf4e68d9b1 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -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 .= "/";
}
diff --git a/lib/base.php b/lib/base.php
index ade4d889631..8adb1cc9102 100644
--- a/lib/base.php
+++ b/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');
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 60fd051f303..3497431f1ee 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -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);
}
/**
diff --git a/lib/util.php b/lib/util.php
index ec92a986008..90cc1f6123a 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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 );