Update card.php

extended switch for using BasicAuth for Windows Phone and DigestAuth e.g. when iPhone tries to connect. Now Baikal is more flexible to support iPhone and Windows Phone on the fly.
This commit is contained in:
Enno 2014-01-18 14:02:30 +01:00
parent 58c58c0817
commit 987e7ec5cd

View file

@ -52,7 +52,7 @@ if(!defined("BAIKAL_CARD_ENABLED") || BAIKAL_CARD_ENABLED !== TRUE) {
}
# Backends
if( BAIKAL_DAV_AUTH_TYPE == "Basic" )
if( BAIKAL_DAV_AUTH_TYPE == "Basic" || preg_match('/Windows-Phone-WebDAV-Client/i', $_SERVER['HTTP_USER_AGENT']) )
$authBackend = new \Baikal\Core\PDOBasicAuth($GLOBALS["DB"]->getPDO(), BAIKAL_AUTH_REALM);
else
$authBackend = new \Sabre\DAV\Auth\Backend\PDO($GLOBALS["DB"]->getPDO());