diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 2361d5b1..578265a4 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -265,6 +265,8 @@ class DAVResource } else if ( $this->_is_proxy_request ) { $this->resourcetypes = $this->collection->resourcetypes; + preg_match( '#^/[^/]+/calendar-proxy-(read|write)/?[^/]*$#', $this->dav_name, $matches ); + $this->proxy_type = $matches[1]; } if ( isset($this->collection->dav_displayname) ) $this->collection->displayname = $this->collection->dav_displayname; } @@ -1103,6 +1105,18 @@ EOQRY; } + /** + * Checks whether this resource is a proxy collection + * @param string $type The type of proxy collection, 'read', 'write' or 'any' + */ + function IsProxyCollection( $type = 'any' ) { + if ( $this->_is_proxy_request ) { + return ($type == 'any' || $type == $this->proxy_type); + } + return false; + } + + /** * Checks whether this resource is a scheduling inbox/outbox collection * @param string $type The type of scheduling collection, 'inbox', 'outbox' or 'any'