. * */ require_once('lib/base.php'); oc_require_once('HTTP/WebDAV/Server/Filesystem.php'); ini_set('default_charset', 'UTF-8'); #ini_set('error_reporting', ''); ob_clean(); if(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) { header('WWW-Authenticate: Basic realm="ownCloud"'); header('HTTP/1.0 401 Unauthorized'); die('401 Unauthorized'); } $user=$_SERVER['PHP_AUTH_USER']; $passwd=$_SERVER['PHP_AUTH_PW']; if(OC_USER::login($user,$passwd)){ OC_UTIL::setUpFS(); $server = new HTTP_WebDAV_Server_Filesystem(); $server->db_name = $CONFIG_DBNAME; $server->ServeRequest($CONFIG_DATADIRECTORY); }else{ header('WWW-Authenticate: Basic realm="ownCloud"'); header('HTTP/1.0 401 Unauthorized'); die('401 Unauthorized'); } ?>