mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-07-08 09:51:16 +00:00
Implement support for 'Brief' header.
Also add VPOLL and VAVAILABILITY to list of supported components.
This commit is contained in:
parent
016dbefcfa
commit
e9e5073eb5
@ -105,6 +105,11 @@ class CalDAVRequest
|
||||
*/
|
||||
public $ticket;
|
||||
|
||||
/**
|
||||
* Whether this request included the 'Brief: T' header.
|
||||
*/
|
||||
public $brief_response;
|
||||
|
||||
/**
|
||||
* Create a new CalDAVRequest object.
|
||||
*/
|
||||
@ -113,6 +118,8 @@ class CalDAVRequest
|
||||
|
||||
$this->options = $options;
|
||||
if ( !isset($this->options['allow_by_email']) ) $this->options['allow_by_email'] = false;
|
||||
|
||||
$this->brief_response = (isset($_SERVER['HTTP_BRIEF']) && (strtoupper($_SERVER['HTTP_BRIEF']) == 'T'));
|
||||
|
||||
/**
|
||||
* Our path is /<script name>/<user name>/<user controlled> if it ends in
|
||||
|
||||
@ -1636,13 +1636,13 @@ EOQRY;
|
||||
if ( isset($this->dead_properties[$tag]) ) {
|
||||
$set_of_components = explode('"', $this->dead_properties[$tag]);
|
||||
foreach( $set_of_components AS $k => $v ) {
|
||||
if ( !preg_match('{(VEVENT|VTODO|VJOURNAL|VTIMEZONE|VFREEBUSY)}', $v) ) {
|
||||
if ( !preg_match('{(VEVENT|VTODO|VJOURNAL|VTIMEZONE|VFREEBUSY|VPOLL|VAVAILABILITY)}', $v) ) {
|
||||
unset( $set_of_components[$k] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$set_of_components = array( 'VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE', 'VFREEBUSY' );
|
||||
$set_of_components = array( 'VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE', 'VFREEBUSY', 'VPOLL', 'VAVAILABILITY' );
|
||||
}
|
||||
}
|
||||
else if ( $this->IsSchedulingCollection() )
|
||||
@ -1800,7 +1800,7 @@ EOQRY;
|
||||
$elements[] = new XMLElement( 'propstat', array( $noprop, $status) );
|
||||
}
|
||||
|
||||
if ( count($not_found) > 0 ) {
|
||||
if ( !(isset($request->brief_response) && $request->brief_response) && count($not_found) > 0 ) {
|
||||
$status = new XMLElement('status', 'HTTP/1.1 404 Not Found' );
|
||||
$noprop = new XMLElement('prop');
|
||||
foreach( $not_found AS $k => $v ) {
|
||||
|
||||
@ -200,7 +200,7 @@ function component_to_xml( $properties, $item ) {
|
||||
$elements[] = new XMLElement( "propstat", array( $noprop, $status) );
|
||||
}
|
||||
|
||||
if ( count($unsupported) > 0 ) {
|
||||
if ( !(isset($request->brief_response) && $request->brief_response) && count($unsupported) > 0 ) {
|
||||
$status = new XMLElement("status", "HTTP/1.1 404 Not Found" );
|
||||
$noprop = new XMLElement("prop");
|
||||
foreach( $unsupported AS $k => $v ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user