* @copyright Catalyst .Net Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once("AwlCache.php"); require_once("XMLDocument.php"); require_once("DAVPrincipal.php"); require_once("DAVTicket.php"); define('DEPTH_INFINITY', 9999); /** * A class for collecting things to do with this request. * * @package davical */ class CalDAVRequest { var $options; /** * The raw data sent along with the request */ var $raw_post; /** * The HTTP request method: PROPFIND, LOCK, REPORT, OPTIONS, etc... */ var $method; /** * The depth parameter from the request headers, coerced into a valid integer: 0, 1 * or DEPTH_INFINITY which is defined above. The default is set per various RFCs. */ var $depth; /** * The 'principal' (user/resource/...) which this request seeks to access * @var DAVPrincipal */ var $principal; /** * The 'current_user_principal_xml' the DAV:current-user-principal answer. An * XMLElement object with an or fragment. */ var $current_user_principal_xml; /** * The user agent making the request. */ var $user_agent; /** * The ID of the collection containing this path, or of this path if it is a collection */ var $collection_id; /** * The path corresponding to the collection_id */ var $collection_path; /** * The type of collection being requested: * calendar, schedule-inbox, schedule-outbox */ var $collection_type; /** * The type of collection being requested: * calendar, schedule-inbox, schedule-outbox */ protected $exists; /** * The value of any 'Destionation:' header, if present. */ var $destination; /** * The decimal privileges allowed by this user to the identified resource. */ protected $privileges; /** * A static structure of supported privileges. */ var $supported_privileges; /** * A DAVTicket object, if there is a ?ticket=id or Ticket: id with this request */ public $ticket; /** * An array of values from the 'Prefer' header. At present only 'return=minimal' is acted on in any way - you * can test that value with the PreferMinimal() method. */ private $prefer; /** * Create a new CalDAVRequest object. */ function __construct( $options = array() ) { global $session, $c, $debugging; $this->options = $options; if ( !isset($this->options['allow_by_email']) ) $this->options['allow_by_email'] = false; if ( isset($_SERVER['HTTP_PREFER']) ) { $this->prefer = explode( ',', $_SERVER['HTTP_PREFER']); } else if ( isset($_SERVER['HTTP_BRIEF']) && (strtoupper($_SERVER['HTTP_BRIEF']) == 'T') ) { $this->prefer = array( 'return=minimal'); } else $this->prefer = array(); /** * Our path is /