diff --git a/htdocs/caldav.php b/htdocs/caldav.php index 2083fb6f..8b0d9334 100644 --- a/htdocs/caldav.php +++ b/htdocs/caldav.php @@ -19,11 +19,16 @@ if ( isset($_SERVER['PATH_INFO']) && preg_match( '{^(/favicon.ico|davical.css|(i } exit(0); } -elseif ( isset($_SERVER['PATH_INFO']) && preg_match( '{^/\.well-known/(.+)$}', $_SERVER['PATH_INFO'], $matches ) ) { - require ('well-known.php'); +require_once('./always.php'); + +if ( isset($_SERVER['PATH_INFO']) && preg_match( '{^/\.well-known/(.+)$}', $_SERVER['PATH_INFO'], $matches ) ) { + require ('well-known.php'); + exit(0); +} +elseif ( isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/autodiscover/autodiscover.xml' ) { + require ('autodiscover-handler.php'); exit(0); } -require_once('./always.php'); function logRequestHeaders() { global $c; diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 1eecbec0..3eedab18 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -114,28 +114,60 @@ class CalDAVRequest $this->options = $options; if ( !isset($this->options['allow_by_email']) ) $this->options['allow_by_email'] = false; + /** + * Our path is /