fix webdav when not using the default data directory

remotes/origin/stable
Robin 15 years ago
parent 0732264d67
commit 15b284578e
  1. 7
      inc/lib_base.php
  2. 2
      webdav/owncloud.php

@ -46,6 +46,7 @@ if($WEBROOT{0}!=='/'){
// define default config values
$CONFIG_INSTALLED=false;
$CONFIG_DATADIRECTORY=$SERVERROOT.'/data';
$CONFIG_DATADIRECTORY_ROOT=$CONFIG_DATADIRECTORY;// store this in a seperate variable so we can change the data directory to jail users.
$CONFIG_HTTPFORCESSL=false;
$CONFIG_DATEFORMAT='j M Y G:i';
$CONFIG_DBNAME='owncloud';
@ -71,12 +72,12 @@ oc_require_once('lib_user.php');
oc_require_once('lib_ocs.php');
if(!is_dir($CONFIG_DATADIRECTORY)){
mkdir($CONFIG_DATADIRECTORY);
if(!is_dir($CONFIG_DATADIRECTORY_ROOT)){
mkdir($CONFIG_DATADIRECTORY_ROOT);
}
if(OC_USER::isLoggedIn()){
//jail the user in a seperate data folder
$CONFIG_DATADIRECTORY.='/'.$_SESSION['username_clean'];
$CONFIG_DATADIRECTORY=$CONFIG_DATADIRECTORY_ROOT.'/'.$_SESSION['username_clean'];
if(!is_dir($CONFIG_DATADIRECTORY)){
mkdir($CONFIG_DATADIRECTORY);
}

@ -39,7 +39,7 @@ 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=$SERVERROOT.'/data/'.$_SESSION['username_clean'];
$CONFIG_DATADIRECTORY=$CONFIG_DATADIRECTORY_ROOT.'/'.$_SESSION['username_clean'];
if(!is_dir($CONFIG_DATADIRECTORY)){
mkdir($CONFIG_DATADIRECTORY);
}

Loading…
Cancel
Save