From 44ba4443f621e73eb815069881348fee01fd4829 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 7 Oct 2011 09:58:20 +0200 Subject: [PATCH] Move well-known.php into the include directory. Also start to add some basic support for autodiscover.xml handling. --- htdocs/caldav.php | 11 ++++++++--- inc/autodiscover-handler.php | 2 ++ {htdocs => inc}/well-known.php | 2 -- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 inc/autodiscover-handler.php rename {htdocs => inc}/well-known.php (99%) 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/autodiscover-handler.php b/inc/autodiscover-handler.php new file mode 100644 index 00000000..9eda2e6c --- /dev/null +++ b/inc/autodiscover-handler.php @@ -0,0 +1,2 @@ +