]> source.dussan.org Git - nextcloud-server.git/commitdiff
provide early file system when using webdav
authorRobin Appelman <icewind@owncloud.com>
Sun, 5 Feb 2012 22:49:22 +0000 (23:49 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 21 Feb 2012 19:48:48 +0000 (20:48 +0100)
lib/connector/sabre/auth.php
lib/util.php

index 1e87c7cee08422484a229fc2e1b93b02c43447a9..8964ef7d0de45d21ec55e47edf5d913486a6d70b 100644 (file)
@@ -23,6 +23,7 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
         * @return bool
         */
        protected function validateUserPass($username, $password){
+               OC_Util::setUpFS();//login hooks may need early access to the filesystem
                if(OC_User::login($username,$password)){
                        OC_Util::setUpFS();
                        return true;
index 3329789de92e61f53667c9124df49e657a72e520..18a5db3e4eef588a2ac86a7f6dcdb807eaa84cb7 100644 (file)
@@ -8,6 +8,7 @@ class OC_Util {
        public static $scripts=array();
        public static $styles=array();
        public static $headers=array();
+       private static $rootMounted=false;
        private static $fsSetup=false;
 
        // Can be set up
@@ -36,7 +37,10 @@ class OC_Util {
                }
 
                //first set up the local "root" storage
-               OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT),'/');
+               if(!self::$rootMounted){
+                       OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT),'/');
+                       self::$rootMounted=true;
+               }
                if( $user != "" ){ //if we aren't logged in, there is no use to set up the filesystem
 
                        OC::$CONFIG_DATADIRECTORY = $CONFIG_DATADIRECTORY_ROOT."/$user/$root";