mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 17:04:14 +01:00
Improved WebDAV
This commit is contained in:
parent
786e16749f
commit
352ad138a6
22
webdav.php
22
webdav.php
@ -25,13 +25,16 @@ $starttime = microtime(true);
|
||||
*/
|
||||
function check_access(&$account)
|
||||
{
|
||||
$account = array(
|
||||
'login' => $_SERVER['PHP_AUTH_USER'],
|
||||
'passwd' => $_SERVER['PHP_AUTH_PW'],
|
||||
'passwd_type' => 'text',
|
||||
);
|
||||
if (!isset($_SERVER['PHP_AUTH_USER']) ||
|
||||
!($sessionid = $GLOBALS['egw']->session->create($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'],'text')))
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
$user = $_SERVER['PHP_AUTH_USER'];
|
||||
$pass = $_SERVER['PHP_AUTH_PW'];
|
||||
}
|
||||
elseif(isset($_GET['auth']))
|
||||
{
|
||||
list($user,$pass) = explode(':',base64_decode($_GET['auth']),2);
|
||||
}
|
||||
if (!isset($user) || !($sessionid = $GLOBALS['egw']->session->create($user,$pass,'text')))
|
||||
{
|
||||
header('WWW-Authenticate: Basic realm="'.vfs_webdav_server::REALM.
|
||||
// if the session class gives a reason why the login failed --> append it to the REALM
|
||||
@ -87,10 +90,11 @@ catch (egw_exception_no_permission_app $e)
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
//$headertime = microtime(true);
|
||||
|
||||
$headertime = microtime(true);
|
||||
// webdav is stateless: we dont need to keep the session open, it only blocks other calls to same basic-auth session
|
||||
$GLOBALS['egw']->session->commit_session();
|
||||
|
||||
$webdav_server = new vfs_webdav_server();
|
||||
$webdav_server->ServeRequest();
|
||||
//error_log(sprintf("WebDAV %s request took %5.3f s (header include took %5.3f s)",$_SERVER['REQUEST_METHOD'],microtime(true)-$starttime,$headertime-$starttime));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user