From c97c489a52f6ec7467e0792009546e68ac4eb640 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 11 Sep 2009 11:04:06 +1200 Subject: [PATCH] Handle /principals/*/user requests as Depth: 0 on principal --- ChangeLog | 4 + inc/CalDAVPrincipal.php | 32 +- inc/CalDAVRequest.php | 19 +- inc/always.php | 13 +- inc/always.php.in | 13 +- .../regression-suite/511-iCal-PROPFIND.result | 12 +- .../552-iPhone-PROPFIND.result | 39 + .../regression-suite/552-iPhone-PROPFIND.test | 32 + .../553-iPhone-PROPFIND.result | 141 ++++ .../regression-suite/553-iPhone-PROPFIND.test | 31 + .../554-iPhone-PROPFIND.result | 735 ++++++++++++++++++ .../regression-suite/554-iPhone-PROPFIND.test | 32 + .../regression-suite/827-Spec-PROPFIND.result | 10 +- .../870-Principal-PROPFIND.result | 2 +- 14 files changed, 1076 insertions(+), 39 deletions(-) create mode 100644 testing/tests/regression-suite/552-iPhone-PROPFIND.result create mode 100644 testing/tests/regression-suite/552-iPhone-PROPFIND.test create mode 100644 testing/tests/regression-suite/553-iPhone-PROPFIND.result create mode 100644 testing/tests/regression-suite/553-iPhone-PROPFIND.test create mode 100644 testing/tests/regression-suite/554-iPhone-PROPFIND.result create mode 100644 testing/tests/regression-suite/554-iPhone-PROPFIND.test diff --git a/ChangeLog b/ChangeLog index d1ee65dd..ce2a5fc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-11 Andrew McMillan + * Add support for /principals/user/username so iPhone (& possibly + also iCal) users have a simpler setup experience. + 2009-09-05 Andrew McMillan * Fix call-time pass by reference warnings. diff --git a/inc/CalDAVPrincipal.php b/inc/CalDAVPrincipal.php index 8433ec58..1e9ac75f 100644 --- a/inc/CalDAVPrincipal.php +++ b/inc/CalDAVPrincipal.php @@ -132,6 +132,11 @@ class CalDAVPrincipal if ( !isset($usr) || !is_object($usr) ) return false; $this->InitialiseRecord($usr); + + if ( is_array($parameters) && isset($parameters['path']) && preg_match('#^/principals/#', $parameters['path']) ) { + // Force it to match + $this->url = $parameters['path']; + } } @@ -148,15 +153,15 @@ class CalDAVPrincipal if ( !isset($this->created) ) $this->created = ISODateToHTTPDate($this->joined); $this->by_email = false; - $this->url = ConstructURL( "/".$this->username."/" ); + $this->url = ConstructURL( "/".$this->username."/", true ); $this->calendar_home_set = array( $this->url ); $this->user_address_set = array( "mailto:".$this->email, - ConstructURL( "/".$this->username."/" ), -// ConstructURL( "/~".$this->username."/" ), -// ConstructURL( "/__uuids__/".$this->username."/" ), + ConstructURL( "/".$this->username."/", true ), +// ConstructURL( "/~".$this->username."/", true ), +// ConstructURL( "/__uuids__/".$this->username."/", true ), ); $this->schedule_inbox_url = sprintf( "%s.in/", $this->url); $this->schedule_outbox_url = sprintf( "%s.out/", $this->url); @@ -167,7 +172,7 @@ class CalDAVPrincipal $qry = new PgQuery("SELECT * FROM relationship LEFT JOIN usr ON (from_user = usr.user_no) LEFT JOIN role_member ON (to_user = role_member.user_no) LEFT JOIN roles USING (role_no) WHERE to_user = ? AND role_name = 'Group';", $this->user_no ); if ( $qry->Exec("CalDAVPrincipal") && $qry->rows > 0 ) { while( $membership = $qry->Fetch() ) { - $this->group_member_set[] = ConstructURL( "/". $membership->username . "/"); + $this->group_member_set[] = ConstructURL( "/". $membership->username . "/", true); } } @@ -175,7 +180,7 @@ class CalDAVPrincipal $qry = new PgQuery("SELECT * FROM relationship LEFT JOIN usr ON (to_user = user_no) LEFT JOIN role_member USING (user_no) LEFT JOIN roles USING (role_no) WHERE from_user = ? AND role_name = 'Group';", $this->user_no ); if ( $qry->Exec("CalDAVPrincipal") && $qry->rows > 0 ) { while( $membership = $qry->Fetch() ) { - $this->group_membership[] = ConstructURL( "/". $membership->username . "/"); + $this->group_membership[] = ConstructURL( "/". $membership->username . "/", true); } } @@ -199,17 +204,17 @@ class CalDAVPrincipal if ($relationship->confers == "R") { if ($relationship->from_user_no == $this->user_no) { // spec says without trailing slash, CalServ does it with slash, and so do we. - $this->group_membership[] = ConstructURL( "/". $relationship->to_username . "/calendar-proxy-read/"); - $this->read_proxy_for[] = ConstructURL( "/". $relationship->to_username . "/"); + $this->group_membership[] = ConstructURL( "/". $relationship->to_username . "/calendar-proxy-read/", true); + $this->read_proxy_for[] = ConstructURL( "/". $relationship->to_username . "/", true); } else /* ($relationship->to_user_no == $this->user_no) */ { - $this->read_proxy_group[] = ConstructURL( "/". $relationship->from_username . "/"); + $this->read_proxy_group[] = ConstructURL( "/". $relationship->from_username . "/", true); } } else if (preg_match("/[WA]/", $relationship->confers)) { if ($relationship->from_user_no == $this->user_no) { - $this->group_membership[] = ConstructURL( "/". $relationship->to_username . "/calendar-proxy-write/"); - $this->write_proxy_for[] = ConstructURL( "/". $relationship->to_username . "/"); + $this->group_membership[] = ConstructURL( "/". $relationship->to_username . "/calendar-proxy-write/", true); + $this->write_proxy_for[] = ConstructURL( "/". $relationship->to_username . "/", true); } else /* ($relationship->to_user_no == $this->user_no) */ { - $this->write_proxy_group[] = ConstructURL( "/". $relationship->from_username . "/"); + $this->write_proxy_group[] = ConstructURL( "/". $relationship->from_username . "/", true); } } } @@ -224,7 +229,7 @@ class CalDAVPrincipal $this->calendar_free_busy_set = array(); if( $qry->Exec("CalDAVPrincipal",__LINE__,__FILE__) && $qry->rows > 0 ) { while( $calendar = $qry->Fetch() ) { - $this->calendar_free_busy_set[] = ConstructURL($calendar->dav_name); + $this->calendar_free_busy_set[] = ConstructURL($calendar->dav_name, true); } } @@ -249,6 +254,7 @@ class CalDAVPrincipal @dbg_error_log( "principal", "Path split into at least /// %s /// %s /// %s", $path_split[1], $path_split[2], $path_split[3] ); $username = $path_split[1]; + if ( $path_split[1] == 'principals' ) $username = $path_split[3]; if ( substr($username,0,1) == '~' ) $username = substr($username,1); if ( isset($options['allow_by_email']) && $options['allow_by_email'] && preg_match( '#/(\S+@\S+[.]\S+)$#', $path, $matches) ) { diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 7465e0e3..7504879c 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -186,13 +186,9 @@ class CalDAVRequest * 4. otherwise we query the defined relationships between users and use * the minimum privileges returned from that analysis. */ - $this->path = (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ""); - if ( $this->path == null || $this->path == '' ) { - $this->path = '/'; - } - else { - $this->path = rawurldecode($this->path); - } + $this->path = (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "/"); + $this->path = rawurldecode($this->path); + // dbg_error_log( "caldav", "Sanitising path '%s'", $this->path ); $bad_chars_regex = '/[\\^\\[\\(\\\\]/'; if ( preg_match( $bad_chars_regex, $this->path ) ) { @@ -274,7 +270,7 @@ EOSQL; $this->collection_path = $this->path; $this->_is_principal = true; } - else if ( preg_match( '#^(/[^/]+)/?$#', $this->path, $matches) ) { + else if ( preg_match( '#^(/[^/]+)/?$#', $this->path, $matches) || preg_match( '#^(/principals/[^/]+/[^/]+)/?$#', $this->path, $matches) ) { $this->collection_id = -1; $this->collection_path = $matches[1].'/'; // Enforce trailling '/' $this->collection_type = 'principal'; @@ -284,6 +280,10 @@ EOSQL; dbg_error_log( "caldav", "Path is actually a collection - sending Content-Location header." ); header( "Content-Location: ".ConstructURL($this->path) ); } + if ( preg_match( '#^(/principals/[^/]+/[^/]+)/?$#', $this->path, $matches) ) { + // Force a depth of 0 on these, which are at the wrong URL. + $this->depth = 0; + } } else if ( $this->path == '/' ) { $this->collection_id = -1; @@ -376,6 +376,8 @@ EOSQL; $this->user_no = $session->user_no; $this->username = $session->username; + @dbg_error_log( "WARN", "Call to deprecated CalDAVRequest::UserFromPath()" ); + if ( $this->path == '/' || $this->path == '' ) { dbg_error_log( "caldav", "No useful path split possible" ); return false; @@ -383,6 +385,7 @@ EOSQL; $path_split = explode('/', $this->path ); $this->username = $path_split[1]; + if ( $this->username == 'principals' ) $this->username = $path_split[3]; @dbg_error_log( "caldav", "Path split into at least /// %s /// %s /// %s", $path_split[1], $path_split[2], $path_split[3] ); if ( isset($this->options['allow_by_email']) && preg_match( '#/(\S+@\S+[.]\S+)/?$#', $this->path, $matches) ) { $this->by_email = $matches[1]; diff --git a/inc/always.php b/inc/always.php index 1516932d..6a462fe2 100644 --- a/inc/always.php +++ b/inc/always.php @@ -51,7 +51,9 @@ if ( !isset($_SERVER['SERVER_NAME']) ) { /** * Calculate the simplest form of reference to this page, excluding the PATH_INFO following the script name. */ -$c->protocol_server_port_script = sprintf( "%s://%s%s%s", (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'), $_SERVER['SERVER_NAME'], +$c->protocol_server_port_script = sprintf( "%s://%s%s%s", + (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'), + $_SERVER['SERVER_NAME'], ( ( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') && $_SERVER['SERVER_PORT'] == 80 ) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] == 443 ) @@ -240,7 +242,7 @@ function getStatusMessage($status) { * except for any '/' characters in it. * @param string $partial_path The part of the path after the script name */ -function ConstructURL( $partial_path ) { +function ConstructURL( $partial_path, $force_script = false ) { global $c; $partial_path = rawurlencode($partial_path); @@ -251,9 +253,14 @@ function ConstructURL( $partial_path ) { $c->_url_script_path = $c->protocol_server_port_script . $c->_url_script_path; } - $url = $c->_url_script_path . $partial_path; + $url = $c->_url_script_path; + if ( $force_script ) { + if ( ! preg_match( '#/caldav\.php$#', $url ) ) $url .= '/caldav.php'; + } + $url .= $partial_path; $url = preg_replace( '#^(https?://.+)//#', '$1/', $url ); // Ensure we don't double any '/' $url = preg_replace('#^https?://[^/]+#', '', $url ); // Remove any protocol + hostname portion + return $url; } diff --git a/inc/always.php.in b/inc/always.php.in index e897402b..7e14234e 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -51,7 +51,9 @@ if ( !isset($_SERVER['SERVER_NAME']) ) { /** * Calculate the simplest form of reference to this page, excluding the PATH_INFO following the script name. */ -$c->protocol_server_port_script = sprintf( "%s://%s%s%s", (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'), $_SERVER['SERVER_NAME'], +$c->protocol_server_port_script = sprintf( "%s://%s%s%s", + (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'), + $_SERVER['SERVER_NAME'], ( ( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') && $_SERVER['SERVER_PORT'] == 80 ) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] == 443 ) @@ -240,7 +242,7 @@ function getStatusMessage($status) { * except for any '/' characters in it. * @param string $partial_path The part of the path after the script name */ -function ConstructURL( $partial_path ) { +function ConstructURL( $partial_path, $force_script = false ) { global $c; $partial_path = rawurlencode($partial_path); @@ -251,9 +253,14 @@ function ConstructURL( $partial_path ) { $c->_url_script_path = $c->protocol_server_port_script . $c->_url_script_path; } - $url = $c->_url_script_path . $partial_path; + $url = $c->_url_script_path; + if ( $force_script ) { + if ( ! preg_match( '#/caldav\.php$#', $url ) ) $url .= '/caldav.php'; + } + $url .= $partial_path; $url = preg_replace( '#^(https?://.+)//#', '$1/', $url ); // Ensure we don't double any '/' $url = preg_replace('#^https?://[^/]+#', '', $url ); // Remove any protocol + hostname portion + return $url; } diff --git a/testing/tests/regression-suite/511-iCal-PROPFIND.result b/testing/tests/regression-suite/511-iCal-PROPFIND.result index 98606be2..6ef1a548 100644 --- a/testing/tests/regression-suite/511-iCal-PROPFIND.result +++ b/testing/tests/regression-suite/511-iCal-PROPFIND.result @@ -1,8 +1,8 @@ HTTP/1.1 207 Multi-Status Date: Dow, 01 Jan 2000 00:00:00 GMT DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule -ETag: "f198ba2785d7ce129f5017d877e37a9b" -Content-Length: 878 +ETag: "6a5ca17c5e140b8e593cf5fd51a10003" +Content-Length: 922 Content-Type: text/xml; charset="utf-8" @@ -13,17 +13,17 @@ Content-Type: text/xml; charset="utf-8" DAViCal CalDAV Server - /user1/ + /caldav.php/user1/ - /user1/.in/ + /caldav.php/user1/.in/ - /user1/.out/ + /caldav.php/user1/.out/ mailto:user1@example.net - /user1/ + /caldav.php/user1/ HTTP/1.1 200 OK diff --git a/testing/tests/regression-suite/552-iPhone-PROPFIND.result b/testing/tests/regression-suite/552-iPhone-PROPFIND.result new file mode 100644 index 00000000..4b97c6d8 --- /dev/null +++ b/testing/tests/regression-suite/552-iPhone-PROPFIND.result @@ -0,0 +1,39 @@ +HTTP/1.1 207 Multi-Status +Date: Dow, 01 Jan 2000 00:00:00 GMT +DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule +ETag: "35e75c275075534433a2b68f9691ae20" +Content-Length: 930 +Content-Type: text/xml; charset="utf-8" + + + + + /principals/users/user1/ + + + + /caldav.php/user1/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + User 1 + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + diff --git a/testing/tests/regression-suite/552-iPhone-PROPFIND.test b/testing/tests/regression-suite/552-iPhone-PROPFIND.test new file mode 100644 index 00000000..1d997924 --- /dev/null +++ b/testing/tests/regression-suite/552-iPhone-PROPFIND.test @@ -0,0 +1,32 @@ +# +# Testing with a process similar to iPhone 3 +# +TYPE=PROPFIND +URL=http://mycaldav/principals/users/user1/ +HEAD + +AUTH=user1:user1 + +HEADER=User-Agent: DAVKit/4.0 (728.3); iCalendar/1 (34); iPhone/3.0 7A341 +HEADER=Content-Type: text/xml + +# +# This query from the iPhone seems to discover several things. Firstly they +# get the calendar-home-set URL for this path. Secondly, they ascertain +# whether the calendar supports scheduling, and finally, whether it +# handles some Apple-specific extensions. +# +BEGINDATA + + + + + + + + + + + + +ENDDATA diff --git a/testing/tests/regression-suite/553-iPhone-PROPFIND.result b/testing/tests/regression-suite/553-iPhone-PROPFIND.result new file mode 100644 index 00000000..d9fb11d5 --- /dev/null +++ b/testing/tests/regression-suite/553-iPhone-PROPFIND.result @@ -0,0 +1,141 @@ +HTTP/1.1 207 Multi-Status +Date: Dow, 01 Jan 2000 00:00:00 GMT +DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule +ETag: "6fce1097fe68f06e745b40b2067552c9" +Content-Length: 3027 +Content-Type: text/xml; charset="utf-8" + + + + + / + + + + + + + + + + + + + DAViCal CalDAV Server + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/ + + + User 1 + + + + + + HTTP/1.1 200 OK + + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/manager1/ + + + Manager 1 + + + + + + HTTP/1.1 200 OK + + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/assistant1/ + + + Assistant 1 + + + + + + HTTP/1.1 200 OK + + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/resource1/ + + + Resource 1 + + + + + + HTTP/1.1 200 OK + + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/resource2/ + + + Resource 2 + + + + + + HTTP/1.1 200 OK + + + + + + + + HTTP/1.1 404 Not Found + + + diff --git a/testing/tests/regression-suite/553-iPhone-PROPFIND.test b/testing/tests/regression-suite/553-iPhone-PROPFIND.test new file mode 100644 index 00000000..ce38e4fb --- /dev/null +++ b/testing/tests/regression-suite/553-iPhone-PROPFIND.test @@ -0,0 +1,31 @@ +# +# Testing with a process similar to iPhone 3 +# +TYPE=PROPFIND +URL=http://mycaldav/ +HEAD + +AUTH=user1:user1 + +HEADER=User-Agent: DAVKit/4.0 (728.3); iCalendar/1 (34); iPhone/3.0 7A341 +HEADER=Content-Type: text/xml +HEADER=Depth: 1 + +# +# This query from the iPhone seems to discover several things. Firstly they +# get the calendar-home-set URL for this path. Secondly, they ascertain +# whether the calendar supports scheduling, and finally, whether it +# handles some Apple-specific extensions. +# +BEGINDATA + + + + + + + + + + +ENDDATA diff --git a/testing/tests/regression-suite/554-iPhone-PROPFIND.result b/testing/tests/regression-suite/554-iPhone-PROPFIND.result new file mode 100644 index 00000000..f7ef4736 --- /dev/null +++ b/testing/tests/regression-suite/554-iPhone-PROPFIND.result @@ -0,0 +1,735 @@ +HTTP/1.1 207 Multi-Status +Date: Dow, 01 Jan 2000 00:00:00 GMT +DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule +ETag: "f31ea9144fd675f7b545ea397f934031" +Transfer-Encoding: chunked +Content-Type: text/xml; charset="utf-8" + + + + + /caldav.php/user1/ + + + + /caldav.php/user1/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + User 1 + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/ + + + user1 home + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/0575d895-a006-4ed8-9be6-0d1b6b6b1f96.ics + + + Due 7/8/7 16:30, completed + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/1906b3ca-4890-468a-9b58-1de74bf2c716.ics + + + Private Event + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/20061101T073004Z.ics + + + A Meeting + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/2178279a-aec2-471f-832d-1f6df6203f2f.ics + + + Incomplete, uncancelled + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/3F4CF6227300FD062D9EF3CDFB30D32D-0.ics + + + Lunch with David + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/4aaf8f37-f232-4c8e-a72e-e171d4c4fe54.ics + + + Weekly Project Meeting + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/71e2ae82-7870-11db-c6d6-f6927c144649.ics + + + Beer O'Clock + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/917b9e47-b748-4550-a566-657fbe672447.ics + + + 50% Complete, uncancelled + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/9d050be7-8a02-4355-8ed3-02a9fc5f473f.ics + + + Confidential Event + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/AAA9318E-37D9-4319-8626-95ECD3D3B243.ics + + + BBQ @ ML's + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/b1679f77-673d-4f46-b3eb-2420e1bba301.ics + + + A Cancelled Task, with a start and due date + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/da81c0ee-7871-11db-c6d6-f6927c144649.ics + + + Morning Mgmt Mtg + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/e6eb5bc9-f7f9-4a0a-94e8-8e90eefc7d08.ics + + + Release 0.9.3 + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/e70576e9-c1e0-431e-a507-0386fd82f223.ics + + + Morning Meeting + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/home/fbd57454-d966-4a14-8341-abe1edb1ae66.ics + + + Tentative Event + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/created/ + + + created + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/.in/ + + + User 1 Inbox + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/.out/ + + + User 1 Outbox + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/6E20BB7C-EFD9-4F0F-9BDC-5335E04D47E0/ + + + iCal Calendar + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/6E20BB7C-EFD9-4F0F-9BDC-5335E04D47E0/6C8A0D88-E1F9-4FC1-9EDD-DA258ABF2CFA.ics + + + Go to work + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/6E20BB7C-EFD9-4F0F-9BDC-5335E04D47E0/E6BC62F3-77C6-4FB7-BDD3-6882E2F1BE74.ics + + + Celebrate a significant birthday + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/calendar-proxy-read/ + + + /user1/calendar-proxy-read/ + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + + /caldav.php/user1/calendar-proxy-write/ + + + /user1/calendar-proxy-write/ + + /caldav.php/user1/ + + + /caldav.php/user1/.in/ + + + /caldav.php/user1/.out/ + + + mailto:user1@example.net + /caldav.php/user1/ + + + HTTP/1.1 200 OK + + + + + + + HTTP/1.1 404 Not Found + + + diff --git a/testing/tests/regression-suite/554-iPhone-PROPFIND.test b/testing/tests/regression-suite/554-iPhone-PROPFIND.test new file mode 100644 index 00000000..6a4bcf48 --- /dev/null +++ b/testing/tests/regression-suite/554-iPhone-PROPFIND.test @@ -0,0 +1,32 @@ +# +# Testing with a process similar to iPhone 3 +# +TYPE=PROPFIND +URL=http://mycaldav/caldav.php/user1/ +HEAD + +AUTH=user1:user1 + +HEADER=User-Agent: DAVKit/4.0 (728.3); iCalendar/1 (34); iPhone/3.0 7A341 +HEADER=Content-Type: text/xml + +# +# This query from the iPhone seems to discover several things. Firstly they +# get the calendar-home-set URL for this path. Secondly, they ascertain +# whether the calendar supports scheduling, and finally, whether it +# handles some Apple-specific extensions. +# +BEGINDATA + + + + + + + + + + + + +ENDDATA diff --git a/testing/tests/regression-suite/827-Spec-PROPFIND.result b/testing/tests/regression-suite/827-Spec-PROPFIND.result index 6873c9dc..01098fa8 100644 --- a/testing/tests/regression-suite/827-Spec-PROPFIND.result +++ b/testing/tests/regression-suite/827-Spec-PROPFIND.result @@ -47,7 +47,7 @@ - /user1/ + /caldav.php/user1/ @@ -94,7 +94,7 @@ - /manager1/ + /caldav.php/manager1/ @@ -141,7 +141,7 @@ - /assistant1/ + /caldav.php/assistant1/ @@ -188,7 +188,7 @@ - /resource1/ + /caldav.php/resource1/ @@ -235,7 +235,7 @@ - /resource2/ + /caldav.php/resource2/ diff --git a/testing/tests/regression-suite/870-Principal-PROPFIND.result b/testing/tests/regression-suite/870-Principal-PROPFIND.result index 9847f258..c6d79e4e 100644 --- a/testing/tests/regression-suite/870-Principal-PROPFIND.result +++ b/testing/tests/regression-suite/870-Principal-PROPFIND.result @@ -1,7 +1,7 @@ - /user1/ + /caldav.php/user1/