diff options
author | Robin <robin@Amaya.(none)> | 2010-05-11 20:35:29 +0200 |
---|---|---|
committer | Robin <robin@Amaya.(none)> | 2010-05-11 20:35:29 +0200 |
commit | 9e05a0d59295d8bd512df9493e90b5811414cefd (patch) | |
tree | 572cbe39796f82b0ce12b7e84de97422fce7aa3a /webdav | |
parent | 672297531bbd0b161ba393f8eba0ada84310f2ce (diff) | |
download | nextcloud-server-9e05a0d59295d8bd512df9493e90b5811414cefd.tar.gz nextcloud-server-9e05a0d59295d8bd512df9493e90b5811414cefd.zip |
webdav fixes
Diffstat (limited to 'webdav')
-rwxr-xr-x | webdav/owncloud.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/webdav/owncloud.php b/webdav/owncloud.php index 76a3adf9ae9..575e9b43a92 100755 --- a/webdav/owncloud.php +++ b/webdav/owncloud.php @@ -39,11 +39,22 @@ if(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) $user=$_SERVER['PHP_AUTH_USER']; $passwd=$_SERVER['PHP_AUTH_PW']; if(OC_USER::login($user,$passwd)){ - $CONFIG_DATADIRECTORY=$CONFIG_DATADIRECTORY_ROOT.'/'.$_SESSION['username_clean']; + $CONFIG_DATADIRECTORY=$CONFIG_DATADIRECTORY_ROOT.'/'.$user; if(!is_dir($CONFIG_DATADIRECTORY)){ mkdir($CONFIG_DATADIRECTORY); } $rootStorage=new OC_FILESTORAGE_LOCAL(array('datadir'=>$CONFIG_DATADIRECTORY)); + if($CONFIG_ENABLEBACKUP){ + if(!is_dir($CONFIG_BACKUPDIRECTORY)){ + mkdir($CONFIG_BACKUPDIRECTORY); + } + if(!is_dir($CONFIG_BACKUPDIRECTORY.'/'.$user)){ + mkdir($CONFIG_BACKUPDIRECTORY.'/'.$user); + } + $backupStorage=new OC_FILESTORAGE_LOCAL(array('datadir'=>$CONFIG_BACKUPDIRECTORY.'/'.$user)); + $backup=new OC_FILEOBSERVER_BACKUP(array('storage'=>$backupStorage)); + $rootStorage->addObserver($backup); + } OC_FILESYSTEM::mount($rootStorage,'/'); $server = new HTTP_WebDAV_Server_Filesystem(); $server->db_name = $CONFIG_DBNAME; @@ -57,4 +68,4 @@ if(OC_USER::login($user,$passwd)){ -?> +?>
\ No newline at end of file |