diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-19 17:38:04 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-20 17:10:49 +0200 |
commit | 6404476bec76a5c4bc2c6d3bb1508bb1c6c025f2 (patch) | |
tree | 24dfb9b5264757121d581726fa0dd1b6cc5d90d7 /lib | |
parent | cd934d5d8924b51d719ac20025b5fa034c74c3fb (diff) | |
download | nextcloud-server-6404476bec76a5c4bc2c6d3bb1508bb1c6c025f2.tar.gz nextcloud-server-6404476bec76a5c4bc2c6d3bb1508bb1c6c025f2.zip |
Delay setup of FS until OC_Filesystem is used
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 6 | ||||
-rw-r--r-- | lib/filesystem.php | 1 | ||||
-rwxr-xr-x | lib/util.php | 8 |
3 files changed, 6 insertions, 9 deletions
diff --git a/lib/base.php b/lib/base.php index 6e209afebda..b6ca19568fe 100644 --- a/lib/base.php +++ b/lib/base.php @@ -353,12 +353,6 @@ class OC{ OC_User::useBackend( OC_Config::getValue( "userbackend", "database" )); OC_Group::useBackend(new OC_Group_Database()); - // Set up file system unless forbidden - global $RUNTIME_NOSETUPFS; - if(!$RUNTIME_NOSETUPFS ){ - OC_Util::setupFS(); - } - // Load Apps // This includes plugins for users and filesystems as well global $RUNTIME_NOAPPS; diff --git a/lib/filesystem.php b/lib/filesystem.php index 0d0943d3639..aeeb012f373 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -488,4 +488,5 @@ class OC_Filesystem{ } } +OC_Util::setupFS(); require_once('filecache.php'); diff --git a/lib/util.php b/lib/util.php index f0999b6d201..46c9e0ef927 100755 --- a/lib/util.php +++ b/lib/util.php @@ -14,7 +14,7 @@ class OC_Util { public static $core_scripts=array(); // Can be set up - public static function setupFS( $user = "", $root = "files" ){// configure the initial filesystem based on the configuration + public static function setupFS( $user = '' ){// configure the initial filesystem based on the configuration if(self::$fsSetup){//setting up the filesystem twice can only lead to trouble return false; } @@ -32,13 +32,14 @@ class OC_Util { } if( $user != "" ){ //if we aren't logged in, there is no use to set up the filesystem - $userdirectory = $CONFIG_DATADIRECTORY."/$user/$root"; + $user_dir = '/'.$user.'/files'; + $userdirectory = $CONFIG_DATADIRECTORY.$user_dir; if( !is_dir( $userdirectory )){ mkdir( $userdirectory, 0755, true ); } //jail the user into his "home" directory - OC_Filesystem::init('/'.$user.'/'.$root); + OC_Filesystem::init($user_dir); $quotaProxy=new OC_FileProxy_Quota(); OC_FileProxy::register($quotaProxy); self::$fsSetup=true; @@ -51,6 +52,7 @@ class OC_Util { } } } + OC_Hook::emit('OC_Filesystem', 'setup', array('user' => $user, 'user_dir' => $user_dir)); } } |