226 if ( $row ==
null )
return;
228 $this->exists =
true;
230 $this->
bound_from = (isset($row->bound_from)? $row->bound_from : $row->dav_name);
231 $this->_is_collection = preg_match(
'{/$}', $this->
dav_name );
233 if ( $this->_is_collection ) {
234 $this->contenttype =
'httpd/unix-directory';
235 $this->collection = (object) array();
238 $this->_is_principal = preg_match(
'{^/[^/]+/$}', $this->
dav_name );
239 if ( preg_match(
'#^(/principals/[^/]+/[^/]+)/?$#', $this->
dav_name, $matches) ) {
240 $this->collection->dav_name = $matches[1].
'/';
241 $this->collection->type =
'principal_link';
242 $this->_is_principal =
true;
247 if ( isset($row->dav_id) ) $this->
resource_id = $row->dav_id;
250 dbg_error_log(
'DAVResource',
':FromRow: Named "%s" is%s a collection.', $this->
dav_name, ($this->_is_collection?
'':
' not') );
252 foreach( $row AS $k => $v ) {
253 if ( $this->_is_collection )
254 $this->collection->{$k} = $v;
263 case 'resourcetypes':
264 if ( $this->_is_collection ) $this->{$k} = $v;
274 if ( $this->_is_collection ) {
275 if ( !isset( $this->collection->type ) || $this->collection->type ==
'collection' ) {
276 if ( $this->_is_principal )
277 $this->collection->type =
'principal';
278 else if ( $row->is_calendar ==
't' ) {
279 $this->collection->type =
'calendar';
281 else if ( $row->is_addressbook ==
't' ) {
282 $this->collection->type =
'addressbook';
284 else if ( isset($row->is_proxy) && $row->is_proxy ==
't' ) {
285 $this->collection->type =
'proxy';
287 else if ( preg_match(
'#^((/[^/]+/)\.(in|out)/)[^/]*$#', $this->dav_name, $matches ) )
288 $this->collection->type =
'schedule-'. $matches[3].
'box';
289 else if ( $this->dav_name ==
'/' )
290 $this->collection->type =
'root';
292 $this->collection->type =
'collection';
295 $this->_is_calendar = ($this->collection->is_calendar ==
't');
296 $this->_is_addressbook = ($this->collection->is_addressbook ==
't');
297 $this->_is_proxy_resource = ($this->collection->type ==
'proxy');
298 if ( $this->_is_principal && !isset($this->resourcetypes) ) {
299 $this->resourcetypes =
'<DAV::collection/><DAV::principal/>';
301 else if ( $this->_is_proxy_resource ) {
302 $this->resourcetypes = $this->collection->resourcetypes;
303 preg_match(
'#^/[^/]+/calendar-proxy-(read|write)/?[^/]*$#', $this->dav_name, $matches );
304 $this->proxy_type = $matches[1];
306 if ( isset($this->collection->dav_displayname) ) $this->collection->displayname = $this->collection->dav_displayname;
309 $this->resourcetypes =
'';
310 if ( isset($this->resource->caldav_data) ) {
311 if ( isset($this->resource->summary) )$this->resource->displayname = $this->resource->summary;
312 if ( strtoupper(substr($this->resource->caldav_data,0,15)) ==
'BEGIN:VCALENDAR' ) {
313 $this->contenttype =
'text/calendar';
314 if ( isset($this->resource->caldav_type) ) $this->contenttype .=
"; component=" . strtolower($this->resource->caldav_type);
315 if ( !$this->HavePrivilegeTo(
'read') && $this->HavePrivilegeTo(
'read-free-busy') ) {
316 $vcal =
new iCalComponent($this->resource->caldav_data);
317 $confidential = $vcal->CloneConfidential();
318 $this->resource->caldav_data = $confidential->Render();
319 $this->resource->displayname = $this->resource->summary = translate(
'Busy');
320 $this->resource->description =
null;
321 $this->resource->location =
null;
322 $this->resource->url =
null;
325 if ( isset($this->resource->class) && strtoupper($this->resource->class)==
'CONFIDENTIAL' && !$this->HavePrivilegeTo(
'all') && $session->user_no != $this->resource->user_no ) {
326 $vcal =
new iCalComponent($this->resource->caldav_data);
327 $confidential = $vcal->CloneConfidential();
328 $this->resource->caldav_data = $confidential->Render();
330 if ( isset($c->hide_alarm) && $c->hide_alarm && !$this->HavePrivilegeTo(
'write') ) {
331 $vcal1 =
new iCalComponent($this->resource->caldav_data);
332 $comps = $vcal1->GetComponents();
333 $vcal2 =
new iCalComponent();
335 foreach( $comps AS $comp ) {
336 $comp->ClearComponents(
'VALARM');
337 $vcal2->AddComponent($comp);
339 $this->resource->displayname = $this->resource->summary = $vcal2->GetPValue(
'SUMMARY');
340 $this->resource->caldav_data = $vcal2->Render();
344 else if ( strtoupper(substr($this->resource->caldav_data,0,11)) ==
'BEGIN:VCARD' ) {
345 $this->contenttype =
'text/vcard';
347 else if ( strtoupper(substr($this->resource->caldav_data,0,11)) ==
'BEGIN:VLIST' ) {
348 $this->contenttype =
'text/x-vlist';
565 dbg_error_log(
'DAVResource',
':FetchCollection: Looking for collection for "%s".', $this->dav_name );
568 $cache = getCacheInstance();
569 $cache_ns =
'collection-'.preg_replace(
'{/[^/]*$}',
'/', $this->dav_name);
570 $cache_key =
'dav_resource'.$session->user_no;
571 $this->collection = $cache->get( $cache_ns, $cache_key );
572 if ( $this->collection ===
false ) {
573 $this->ReadCollectionFromDatabase();
574 if ( $this->collection->type !=
'principal' && $this->_collection_is_cacheable ) {
575 $cache_ns =
'collection-'.$this->collection->dav_name;
576 @dbg_error_log(
'Cache',
':FetchCollection: Setting cache ns "%s" key "%s". Type: %s', $cache_ns, $cache_key, $this->collection->type );
577 $cache->set( $cache_ns, $cache_key, $this->collection );
579 @dbg_error_log(
'DAVResource',
':FetchCollection: Found collection named "%s" of type "%s".', $this->collection->dav_name, $this->collection->type );
582 @dbg_error_log(
'Cache',
':FetchCollection: Got cache ns "%s" key "%s". Type: %s', $cache_ns, $cache_key, $this->collection->type );
583 if ( preg_match(
'#^(/[^/]+)/?$#', $this->dav_name, $matches)
584 || preg_match(
'#^((/principals/[^/]+/)[^/]+)/?$#', $this->dav_name, $matches) ) {
585 $this->_is_principal =
true;
586 $this->FetchPrincipal();
587 $this->collection->is_principal =
true;
588 $this->collection->type =
'principal';
590 if ($this->collection->type ==
'proxy') {
591 $this->_is_proxy_resource =
true;
592 $this->proxy_type = $this->collection->proxy_type;
595 @dbg_error_log(
'DAVResource',
':FetchCollection: Read cached collection named "%s" of type "%s".', $this->collection->dav_name, $this->collection->type );
598 if ( isset($this->collection->bound_from) ) {
599 $this->_is_binding =
true;
600 $this->bound_from = str_replace( $this->collection->bound_to, $this->collection->bound_from, $this->dav_name);
601 if ( isset($this->collection->access_ticket_id) ) {
602 if ( !isset($this->tickets) ) $this->tickets = array();
603 $this->tickets[] =
new DAVTicket($this->collection->access_ticket_id);
607 $this->_is_collection = ( $this->_is_principal || $this->collection->dav_name == $this->dav_name || $this->collection->dav_name == $this->dav_name.
'/' );
608 if ( $this->_is_collection ) {
609 $this->dav_name = $this->collection->dav_name;
610 $this->resource_id = $this->collection->collection_id;
611 $this->_is_calendar = ($this->collection->type ==
'calendar');
612 $this->_is_addressbook = ($this->collection->type ==
'addressbook');
613 $this->contenttype =
'httpd/unix-directory';
614 if ( !isset($this->exists) && isset($this->collection->exists) ) {
616 $this->exists = $this->collection->exists;
618 if ( $this->exists ) {
619 if ( isset($this->collection->dav_etag) ) $this->unique_tag =
'"'.$this->collection->dav_etag.
'"';
620 if ( isset($this->collection->created) ) $this->created = $this->collection->created;
621 if ( isset($this->collection->modified) ) $this->modified = $this->collection->modified;
622 if ( isset($this->collection->dav_displayname) ) $this->collection->displayname = $this->collection->dav_displayname;
625 if ( !isset($this->parent) ) $this->GetParentContainer();
626 $this->user_no = $this->parent->GetProperty(
'user_no');
628 if ( isset($this->collection->resourcetypes) )
629 $this->resourcetypes = $this->collection->resourcetypes;
631 $this->resourcetypes =
'<DAV::collection/>';
632 if ( $this->_is_principal ) $this->resourcetypes .=
'<DAV::principal/>';
633 if ( $this->_is_addressbook ) $this->resourcetypes .=
'<urn:ietf:params:xml:ns:carddav:addressbook/>';
634 if ( $this->_is_calendar ) $this->resourcetypes .=
'<urn:ietf:params:xml:ns:caldav:calendar/>';
748 global $session, $request;
750 if ( $this->dav_name ==
'/' || $this->dav_name ==
'' || $this->_is_external ) {
751 $this->privileges = (1 | 16 | 32);
752 dbg_error_log(
'DAVResource',
':FetchPrivileges: Read permissions for user accessing /' );
756 if ( $session->AllowedTo(
'Admin') ) {
757 $this->privileges = privilege_to_bits(
'all');
758 dbg_error_log(
'DAVResource',
':FetchPrivileges: Full permissions for an administrator.' );
762 if ( $this->IsPrincipal() ) {
763 if ( !isset($this->principal) ) $this->FetchPrincipal();
764 $this->privileges = $this->principal->Privileges();
765 dbg_error_log(
'DAVResource',
':FetchPrivileges: Privileges of "%s" for user accessing principal "%s"', $this->privileges, $this->principal->username() );
769 if ( ! isset($this->collection) ) $this->FetchCollection();
770 $this->privileges = 0;
771 if ( !isset($this->collection->path_privs) ) {
772 if ( !isset($this->parent) ) $this->GetParentContainer();
774 $this->collection->path_privs = $this->parent->Privileges();
775 $this->collection->user_no = $this->parent->GetProperty(
'user_no');
776 $this->collection->principal_id = $this->parent->GetProperty(
'principal_id');
779 $this->privileges = $this->collection->path_privs;
780 if ( is_string($this->privileges) ) $this->privileges = bindec( $this->privileges );
782 dbg_error_log(
'DAVResource',
':FetchPrivileges: Privileges of "%s" for user "%s" accessing "%s"',
783 decbin($this->privileges), $session->username, $this->dav_name() );
785 if ( isset($request->ticket) && $request->ticket->MatchesPath($this->bound_from()) ) {
786 $this->privileges |= $request->ticket->privileges();
787 dbg_error_log(
'DAVResource',
':FetchPrivileges: Applying permissions for ticket "%s" now: %s', $request->ticket->id(), decbin($this->privileges) );
790 if ( isset($this->tickets) ) {
791 if ( !isset($this->resource_id) ) $this->FetchResource();
792 foreach( $this->tickets AS $k => $ticket ) {
793 if ( $ticket->MatchesResource($this->resource_id()) || $ticket->MatchesPath($this->bound_from()) ) {
794 $this->privileges |= $ticket->privileges();
795 dbg_error_log(
'DAVResource',
':FetchPrivileges: Applying permissions for ticket "%s" now: %s', $ticket->id(), decbin($this->privileges) );
1527 case 'collection_id':
1528 return $this->collection_id();
1531 case 'principal_id':
1532 if ( !isset($this->principal) ) $this->FetchPrincipal();
1533 return $this->principal->principal_id();
1536 case 'resourcetype':
1537 if ( isset($this->resourcetypes) ) {
1538 $this->resourcetypes = preg_replace(
'{^\s*<(.*)/>\s*$}',
'$1', $this->resourcetypes);
1539 $type_list = preg_split(
'{(/>\s*<|\n)}', $this->resourcetypes);
1540 foreach( $type_list AS $k => $resourcetype ) {
1541 if ( preg_match(
'{^([^:]+):([^:]+) \s+ xmlns:([^=]+)="([^"]+)" \s* $}x', $resourcetype, $matches ) ) {
1542 $type_list[$k] = $matches[4] .
':' .$matches[2];
1544 else if ( preg_match(
'{^([^:]+) \s+ xmlns="([^"]+)" \s* $}x', $resourcetype, $matches ) ) {
1545 $type_list[$k] = $matches[2] .
':' .$matches[1];
1552 if ( !isset($this->resource) ) $this->FetchResource();
1553 return clone($this->resource);
1557 if ( !isset($this->resource) ) $this->FetchResource();
1558 dbg_error_log(
'DAVResource',
':GetProperty: dav-data: fetched resource does%s exist.', ($this->exists?
'':
' not') );
1559 return $this->resource->caldav_data;
1563 if ( !isset($this->principal) ) $this->FetchPrincipal();
1564 return clone($this->principal);
1568 if ( isset($this->{$name}) ) {
1569 if ( ! is_object($this->{$name}) )
return $this->{$name};
1570 return clone($this->{$name});
1572 if ( $this->_is_principal ) {
1573 if ( !isset($this->principal) ) $this->FetchPrincipal();
1574 if ( isset($this->principal->{$name}) )
return $this->principal->{$name};
1575 if ( isset($this->collection->{$name}) )
return $this->collection->{$name};
1577 else if ( $this->_is_collection ) {
1578 if ( isset($this->collection->{$name}) )
return $this->collection->{$name};
1579 if ( isset($this->principal->{$name}) )
return $this->principal->{$name};
1582 if ( !isset($this->resource) ) $this->FetchResource();
1583 if ( isset($this->resource->{$name}) )
return $this->resource->{$name};
1584 if ( !isset($this->principal) ) $this->FetchPrincipal();
1585 if ( isset($this->principal->{$name}) )
return $this->principal->{$name};
1586 if ( isset($this->collection->{$name}) )
return $this->collection->{$name};
1588 if ( isset($this->{$name}) ) {
1589 if ( ! is_object($this->{$name}) )
return $this->{$name};
1590 return clone($this->{$name});
1622 global $c, $session, $request;
1626 if ( $reply ===
null ) $reply = $GLOBALS[
'reply'];
1629 case 'DAV::allprop':
1630 $property_list = $this->DAV_AllProperties();
1631 $discarded = array();
1632 foreach( $property_list AS $k => $v ) {
1633 $this->ResourceProperty($v, $prop, $reply, $discarded);
1638 $prop->NewElement(
'href', ConstructURL($this->dav_name) );
1641 case 'DAV::resource-id':
1642 if ( $this->resource_id > 0 )
1643 $reply->DAVElement( $prop,
'resource-id', $reply->href(ConstructURL(
'/.resources/'.$this->resource_id) ) );
1648 case 'DAV::parent-set':
1650SELECT b.parent_container FROM dav_binding b JOIN collection c ON (b.bound_source_id=c.collection_id)
1651 WHERE regexp_replace( b.dav_name,
'^.*/', c.dav_name ) = :bound_from
1653 $qry =
new AwlQuery($sql, array(
':bound_from' => $this->bound_from() ) );
1655 if ( $qry->Exec(
'DAVResource',__LINE__,__FILE__) && $qry->rows() > 0 ) {
1656 while( $row = $qry->Fetch() ) {
1657 $parents[$row->parent_container] =
true;
1660 $parents[preg_replace(
'{(?<=/)[^/]+/?$}',
'',$this->bound_from())] =
true;
1661 $parents[preg_replace(
'{(?<=/)[^/]+/?$}',
'',$this->dav_name())] =
true;
1663 $parent_set = $reply->DAVElement( $prop,
'parent-set' );
1664 foreach( $parents AS $parent => $v ) {
1665 if ( preg_match(
'{^(.*)?/([^/]+)/?$}', $parent, $matches ) ) {
1666 $reply->DAVElement($parent_set,
'parent', array(
1667 new XMLElement(
'href', ConstructURL($matches[1])),
1668 new XMLElement(
'segment', $matches[2])
1671 else if ( $parent ==
'/' ) {
1672 $reply->DAVElement($parent_set,
'parent', array(
1673 new XMLElement(
'href',
'/'),
1674 new XMLElement(
'segment', ( ConstructURL(
'/') ==
'/caldav.php/' ?
'caldav.php' :
''))
1680 case 'DAV::getcontenttype':
1681 if ( !isset($this->contenttype) && !$this->_is_collection && !isset($this->resource) ) $this->FetchResource();
1682 $prop->NewElement(
'getcontenttype', $this->contenttype );
1685 case 'DAV::resourcetype':
1686 $resourcetypes = $prop->NewElement(
'resourcetype' );
1687 if ( $this->_is_collection ) {
1688 $type_list = $this->GetProperty(
'resourcetype');
1689 if ( !is_array($type_list) )
return true;
1691 foreach( $type_list AS $k => $v ) {
1692 if ( $v ==
'' )
continue;
1693 $reply->NSElement( $resourcetypes, $v );
1695 if ( $this->_is_binding ) {
1696 $reply->NSElement( $resourcetypes,
'http://xmlns.davical.org/davical:webdav-binding' );
1701 case 'DAV::getlastmodified':
1703 $reply->NSElement($prop, $tag, ISODateToHTTPDate($this->GetProperty(
'modified')) );
1706 case 'DAV::creationdate':
1708 $reply->NSElement($prop, $tag, DateToISODate($this->GetProperty(
'created'),
true) );
1711 case 'DAV::getcontentlength':
1712 if ( $this->_is_collection )
return false;
1713 if ( !isset($this->resource) ) $this->FetchResource();
1714 if ( isset($this->resource) ) {
1715 $reply->NSElement($prop, $tag, strlen($this->resource->caldav_data) );
1719 case 'DAV::getcontentlanguage':
1720 $locale = (isset($c->current_locale) ? $c->current_locale :
'');
1721 if ( isset($this->locale) && $this->locale !=
'' ) $locale = $this->locale;
1722 $reply->NSElement($prop, $tag, $locale );
1725 case 'DAV::acl-restrictions':
1726 $reply->NSElement($prop, $tag, array(
new XMLElement(
'grant-only'),
new XMLElement(
'no-invert') ) );
1729 case 'DAV::inherited-acl-set':
1730 $inherited_acls = array();
1731 if ( ! $this->_is_collection ) {
1732 $inherited_acls[] = $reply->href(ConstructURL($this->collection->dav_name));
1734 $reply->NSElement($prop, $tag, $inherited_acls );
1739 if ( $this->IsExternal() ){
1740 $reply->DAVElement( $prop,
'owner', $reply->href( ConstructURL($this->collection->bound_from )) );
1743 $reply->DAVElement( $prop,
'owner', $reply->href( ConstructURL(DeconstructURL($this->principal_url())) ) );
1747 case 'DAV::add-member':
1748 if ( ! $this->_is_collection )
return false;
1749 if ( $this->_is_principal )
return false;
1750 if ( isset($c->post_add_member) && $c->post_add_member ===
false )
return false;
1751 $reply->DAVElement( $prop,
'add-member', $reply->href(ConstructURL(DeconstructURL($this->url())).
'?add_member') );
1756 case 'DAV::alternate-URI-set':
1757 $reply->NSElement($prop, $tag );
1760 case 'DAV::getetag':
1761 if ( $this->_is_collection )
return false;
1762 $reply->NSElement($prop, $tag, $this->unique_tag() );
1765 case 'http://calendarserver.org/ns/:getctag':
1766 if ( ! $this->_is_collection )
return false;
1767 $reply->NSElement($prop, $tag, $this->unique_tag() );
1770 case 'DAV::sync-token':
1771 if ( ! $this->_is_collection )
return false;
1772 $sync_token = $this->sync_token();
1773 if ( empty($sync_token) )
return false;
1774 $reply->NSElement($prop, $tag, $sync_token );
1777 case 'http://calendarserver.org/ns/:calendar-proxy-read-for':
1778 $proxy_type =
'read';
1779 case 'http://calendarserver.org/ns/:calendar-proxy-write-for':
1780 if ( isset($c->disable_caldav_proxy) && $c->disable_caldav_proxy )
return false;
1781 if ( !isset($proxy_type) ) $proxy_type =
'write';
1783 $this->FetchPrincipal();
1784 $reply->CalendarserverElement($prop,
'calendar-proxy-'.$proxy_type.
'-for', $reply->href( $this->principal->ProxyFor($proxy_type) ) );
1787 case 'http://calendarserver.org/ns/:group-member-set':
1788 case 'DAV::group-member-set':
1789 if ( $this->_is_proxy_resource ) {
1790 $this->FetchPrincipal();
1791 if ( $this->proxy_type ==
'read' ) {
1792 $reply->DAVElement( $prop,
'group-member-set', $reply->href( $this->principal->ReadProxyGroup() ) );
1794 $reply->DAVElement( $prop,
'group-member-set', $reply->href( $this->principal->WriteProxyGroup() ) );
1801 case 'http://calendarserver.org/ns/:group-membership':
1802 case 'DAV::group-membership':
1803 if ( $this->_is_proxy_resource ) {
1805 $reply->NSElement($prop, $tag );
1811 case 'DAV::current-user-privilege-set':
1812 if ( $this->HavePrivilegeTo(
'DAV::read-current-user-privilege-set') ) {
1813 $reply->NSElement($prop, $tag, $this->BuildPrivileges() );
1820 case 'urn:ietf:params:xml:ns:caldav:supported-calendar-data':
1821 if ( ! $this->IsCalendar() && ! $this->IsSchedulingCollection() )
return false;
1822 $reply->NSElement($prop, $tag,
'text/calendar' );
1825 case 'urn:ietf:params:xml:ns:caldav:supported-calendar-component-set':
1826 if ( ! $this->_is_collection )
return false;
1827 if ( $this->IsCalendar() ) {
1828 if ( !isset($this->dead_properties) ) $this->FetchDeadProperties();
1829 if ( isset($this->dead_properties[$tag]) ) {
1830 $set_of_components = $this->dead_properties[$tag];
1831 foreach( $set_of_components AS $k => $v ) {
1832 if ( preg_match(
'{(VEVENT|VTODO|VJOURNAL|VTIMEZONE|VFREEBUSY|VPOLL|VAVAILABILITY)}', $v, $matches) ) {
1833 $set_of_components[$k] = $matches[1];
1836 unset( $set_of_components[$k] );
1840 else if ( isset($c->default_calendar_components) && is_array($c->default_calendar_components) ) {
1841 $set_of_components = $c->default_calendar_components;
1844 $set_of_components = array(
'VEVENT',
'VTODO',
'VJOURNAL' );
1847 else if ( $this->IsSchedulingCollection() )
1848 $set_of_components = array(
'VEVENT',
'VTODO',
'VFREEBUSY' );
1850 $components = array();
1851 foreach( $set_of_components AS $v ) {
1852 $components[] = $reply->NewXMLElement(
'comp',
'', array(
'name' => $v),
'urn:ietf:params:xml:ns:caldav');
1854 $reply->CalDAVElement($prop,
'supported-calendar-component-set', $components );
1857 case 'DAV::supported-method-set':
1858 $prop->NewElement(
'supported-method-set', $this->BuildSupportedMethods() );
1861 case 'DAV::supported-report-set':
1862 $prop->NewElement(
'supported-report-set', $this->BuildSupportedReports( $reply ) );
1865 case 'DAV::supportedlock':
1866 $prop->NewElement(
'supportedlock',
1867 new XMLElement(
'lockentry',
1869 new XMLElement(
'lockscope',
new XMLElement(
'exclusive')),
1870 new XMLElement(
'locktype',
new XMLElement(
'write')),
1876 case 'DAV::supported-privilege-set':
1877 $prop->NewElement(
'supported-privilege-set', $request->BuildSupportedPrivileges($reply) );
1880 case 'DAV::principal-collection-set':
1881 $prop->NewElement(
'principal-collection-set', $reply->href( ConstructURL(
'/') ) );
1884 case 'DAV::current-user-principal':
1885 $prop->NewElement(
'current-user-principal', $reply->href( ConstructURL(DeconstructURL($session->principal->url())) ) );
1888 case 'SOME-DENIED-PROPERTY':
1889 $denied[] = $reply->Tag($tag);
1892 case 'urn:ietf:params:xml:ns:caldav:calendar-timezone':
1893 if ( ! $this->_is_collection )
return false;
1894 if ( !isset($this->collection->vtimezone) || $this->collection->vtimezone ==
'' )
return false;
1896 $cal =
new iCalComponent();
1898 $cal->AddComponent(
new iCalComponent($this->collection->vtimezone) );
1899 $reply->NSElement($prop, $tag, $cal->Render() );
1902 case 'urn:ietf:params:xml:ns:carddav:address-data':
1903 case 'urn:ietf:params:xml:ns:caldav:calendar-data':
1904 if ( $this->_is_collection )
return false;
1905 if ( !isset($c->sync_resource_data_ok) || $c->sync_resource_data_ok ==
false )
return false;
1906 if ( !isset($this->resource) ) $this->FetchResource();
1907 $reply->NSElement($prop, $tag, $this->resource->caldav_data );
1910 case 'urn:ietf:params:xml:ns:carddav:max-resource-size':
1911 if ( ! $this->_is_collection || !$this->_is_addressbook )
return false;
1912 $reply->NSElement($prop, $tag, $c->carddav_max_resource_size );
1915 case 'urn:ietf:params:xml:ns:carddav:supported-address-data':
1916 if ( ! $this->_is_collection || !$this->_is_addressbook )
return false;
1917 $address_data = $reply->NewXMLElement(
'address-data',
false,
1918 array(
'content-type' =>
'text/vcard',
'version' =>
'3.0'),
'urn:ietf:params:xml:ns:carddav');
1919 $reply->NSElement($prop, $tag, $address_data );
1923 if ( $this->HavePrivilegeTo(
'DAV::read-acl') ) {
1924 $reply->NSElement($prop, $tag, $this->GetACL( $reply ) );
1931 case 'http://www.xythos.com/namespaces/StorageServer:ticketdiscovery':
1932 case 'DAV::ticketdiscovery':
1933 $reply->NSElement($prop,
'http://www.xythos.com/namespaces/StorageServer:ticketdiscovery', $this->BuildTicketinfo($reply) );
1937 $property_value = $this->GetProperty(preg_replace(
'{^(DAV:|urn:ietf:params:xml:ns:ca(rd|l)dav):}',
'', $tag));
1938 if ( isset($property_value) ) {
1939 $reply->NSElement($prop, $tag, $property_value );
1942 if ( !isset($this->dead_properties) ) $this->FetchDeadProperties();
1943 if ( isset($this->dead_properties[$tag]) ) {
1944 $reply->NSElement($prop, $tag, $this->dead_properties[$tag] );