provide early file system when using webdav

This commit is contained in:
Robin Appelman 2012-02-05 23:49:22 +01:00
parent b3a974d8bb
commit 6658f51098
2 changed files with 6 additions and 1 deletions

View 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;

View 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";