mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-30 16:00:25 +00:00
Rewrite the way the DAV header is produced.
This commit is contained in:
parent
baa4438c82
commit
efd40937fe
@ -29,23 +29,31 @@ require_once('./always.php');
|
|||||||
require_once('HTTPAuthSession.php');
|
require_once('HTTPAuthSession.php');
|
||||||
$session = new HTTPAuthSession();
|
$session = new HTTPAuthSession();
|
||||||
|
|
||||||
/**
|
function send_dav_header() {
|
||||||
* access-control is rfc3744, we do some of it, but no way to say that.
|
global $c;
|
||||||
* calendar-schedule is another one we do some of, but the spec is not final yet either.
|
|
||||||
*/
|
/**
|
||||||
if ( isset($c->override_dav_header) ) {
|
* access-control is rfc3744, we do most of it, but no way to say that.
|
||||||
$dav = $c->override_dav_header;
|
* calendar-schedule is another one we do most of, but the spec is not final yet either.
|
||||||
}
|
*/
|
||||||
else {
|
if ( isset($c->override_dav_header) ) {
|
||||||
/** hack to get around bugzilla #463392 - remove sometime after 2011-02-28 */
|
$dav = $c->override_dav_header;
|
||||||
if ( isset($_SERVER['HTTP_USER_AGENT']) && preg_match( '{ Gecko/(20[01]\d[01]\d[0123]\d)(\d+)? }', $_SERVER['HTTP_USER_AGENT'], $matches ) && $matches[1] < 20100520 ) {
|
|
||||||
$dav = '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook';
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$dav = '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule';
|
/** hack to get around bugzilla #463392 - remove sometime after 2011-02-28 */
|
||||||
|
if ( isset($_SERVER['HTTP_USER_AGENT']) && preg_match( '{ Gecko/(20[01]\d[01]\d[0123]\d)(\d+)? }', $_SERVER['HTTP_USER_AGENT'], $matches ) && $matches[1] < 20100520 ) {
|
||||||
|
$dav = '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$dav = '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$dav = explode( "\n", wordwrap( $dav ) );
|
||||||
|
foreach( $dav AS $v ) {
|
||||||
|
header( 'DAV: '.trim($v, ', '), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
header( 'DAV: '.$dav);
|
send_dav_header(); // Avoid polluting global namespace
|
||||||
|
|
||||||
require_once('CalDAVRequest.php');
|
require_once('CalDAVRequest.php');
|
||||||
$request = new CalDAVRequest();
|
$request = new CalDAVRequest();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user