* @copyright Andrew McMillan * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 */ /** * A class for collecting things to do with this request. * * @package rscds */ class CalDAVRequest { /** * Create a new CalDAVRequest object. */ function CalDAVRequest( ) { global $session, $c, $debugging; $this->raw_post = file_get_contents ( 'php://input'); if ( isset($debugging) && isset($_GET['method']) ) { $_SERVER['REQUEST_METHOD'] = $_GET['method']; } $this->method = $_SERVER['REQUEST_METHOD']; /** * A variety of requests may set the "Depth" header to control recursion */ $this->depth = ( isset($_SERVER['HTTP_DEPTH']) ? $_SERVER['HTTP_DEPTH'] : 0 ); if ( $this->depth == 'infinity' ) $this->depth = 99; $this->depth = intval($this->depth); /** * MOVE/COPY use a "Destination" header and (optionally) an "Overwrite" one. */ if ( isset($_SERVER['HTTP_DESTINATION']) ) $this->destination = $_SERVER['HTTP_DESTINATION']; $this->overwrite = ( isset($_SERVER['HTTP_OVERWRITE']) ? $_SERVER['HTTP_OVERWRITE'] : 'T' ); // RFC2518, 9.6 says default True. /** * LOCK things use an "If" header to hold the lock in some cases, and "Lock-token" in others */ if ( isset($_SERVER['HTTP_IF']) ) $this->if_clause = $_SERVER['HTTP_IF']; if ( isset($_SERVER['HTTP_LOCK-TOKEN']) ) $this->lock_token = $_SERVER['HTTP_LOCK-TOKEN']; /** * Our path is /