This commit is contained in:
Net Gusto 2014-11-28 14:31:49 +01:00
parent edbd83585c
commit e51e337fff

View file

@ -55,10 +55,18 @@ if(!defined("BAIKAL_CAL_ENABLED") || BAIKAL_CAL_ENABLED !== TRUE) {
}
# Backends
if( BAIKAL_DAV_AUTH_TYPE == "Basic" || (array_key_exists('HTTP_USER_AGENT', $_SERVER) && 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());
if(
BAIKAL_DAV_AUTH_TYPE == "Basic" || (
array_key_exists('HTTP_USER_AGENT', $_SERVER) && (
preg_match('/Windows-Phone-WebDAV-Client/i', $_SERVER['HTTP_USER_AGENT']) ||
preg_match('/MSFT-WP\/8.10.*/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());
}
$principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($GLOBALS["DB"]->getPDO());
$calendarBackend = new \Sabre\CalDAV\Backend\PDO($GLOBALS["DB"]->getPDO());