Class CalDAVRequest
A class for collecting things to do with this request.
Copyright: Catalyst .Net Ltd, Morphoss Ltd
License: GNU GPL v3 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at CalDAVRequest.php
public
|
|
public
|
#
setPermissions( integer $user_no,… )
Permissions are controlled as follows:
1. if the path is '/', the request has read privileges
2. if the requester is an admin, the request has read/write priviliges
3. if there is a |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
DepthRegexTail( $for_collection_report = false )
Returns the tail of a Regex appropriate for this Depth, when appended to |
public
|
#
GetLockRow( string $lock_token )
Returns the locked row, either from the cache or from the database |
public
|
#
ValidateLockToken( string $lock_token )
Checks to see whether the lock token given matches one of the ones handed in with the request. |
public
|
#
GetLockDetails( string $lock_token )
Returns the DB object associated with a lock token, or false. |
public
mixed
|
#
FailIfLocked( )
This will either (a) return false if no locks apply, or (b) return the lock_token which the request successfully included to open the lock, or: (c) respond directly to the client with the failure. |
public
|
|
public
|
#
PreferMinimal( )
Returns true if the 'Prefer: return=minimal' or 'Brief: t' were present in the request headers. |
public
|
|
public
|
|
public
|
#
IsAddressBook( )
Returns true if the URL referenced by this request points at an addressbook collection. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
BuildSupportedPrivileges( & $reply, $privs = null )
Returns the array of supported privileges converted into XMLElements |
public
|
|
public
|
|
public
|
#
CheckEtagMatch( boolean $exists, string $dest_etag )
Check that the incoming Etag matches the one for the existing (or non-existing) resource. |
public
|
|
public
|
#
UnsupportedRequest( array $unsupported )
Sometimes it's a perfectly formed request, but we just don't do that :-( |
public
|
#
NeedPrivilege( string $privileges, string $href = null )
Send a need-privileges error response. This function will only return if the $href is not supplied and the current user has the specified permission for the request path. |
public
|
#
PreconditionFailed( integer $status, string $precondition, string $explanation = '', $xmlns = 'DAV:' )
Send an error response for a failed precondition. |
public
|
#
MalformedRequest( string $text = 'Bad request' )
Send a simple error informing the client that was a malformed request |
public
|
#
XMLResponse( integer $status, XMLElement $xmltree )
Send an XML Response. This function will never return. |
public static
|
|
public
|
#
DoResponse( integer $status, string $message = "", $content_type = "text/plain; charset=\"utf-8\"" )
Utility function we call when we have a simple status-based response to return to the client. Possibly |
public
|
public
|
$options
|
|
public
|
$raw_post
The raw data sent along with the request |
|
public
|
$method
The HTTP request method: PROPFIND, LOCK, REPORT, OPTIONS, etc... |
|
public
|
$depth
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. |
|
public
|
$principal
The 'principal' (user/resource/...) which this request seeks to access |
|
public
|
$current_user_principal_xml
The 'current_user_principal_xml' the DAV:current-user-principal answer. An
XMLElement object with an |
|
public
|
$user_agent
The user agent making the request. |
|
public
|
$collection_id
The ID of the collection containing this path, or of this path if it is a collection |
|
public
|
$collection_path
The path corresponding to the collection_id |
|
public
|
$collection_type
The type of collection being requested: calendar, schedule-inbox, schedule-outbox |
|
protected
|
$exists
The type of collection being requested: calendar, schedule-inbox, schedule-outbox |
|
public
|
$destination
The value of any 'Destionation:' header, if present. |
|
protected
|
$privileges
The decimal privileges allowed by this user to the identified resource. |
|
public
|
$supported_privileges
A static structure of supported privileges. |
|
public
|
$ticket
A DAVTicket object, if there is a ?ticket=id or Ticket: id with this request |