Class CalDAVRequest

Description

A class for collecting things to do with this request.

Located in /inc/CalDAVRequest.php (line 27)


	
			
Variable Summary
 mixed $depth
 mixed $method
 mixed $options
 mixed $principal
 mixed $raw_post
 mixed $user_agent
Method Summary
 CalDAVRequest CalDAVRequest ([ $options = array()])
 void AllowedTo (string $activity)
 void DepthRegexTail ()
 void DoResponse (int $status, [string $message = ""], [ $content_type = "text/plain; charset=\"utf-8\""])
 mixed FailIfLocked ()
 void GetDepthName ()
 void GetLockDetails (string $lock_token)
 void GetLockRow ( $lock_token, string $dav_name)
 void IsCollection ()
 void IsInfiniteDepth ()
 void IsLocked (string $dav_name)
 void IsPrincipal ()
 void setPermissions (int $user_no)
 void UnsupportedRequest (array $unsupported)
 void UserFromPath ()
 void ValidateLockToken (string $lock_token)
 void XMLResponse (int $status, XMLElement $xmltree)
Variables
mixed $collection_id (line 60)

The ID of the collection containing this path, or of this path if it is a collection

mixed $collection_path (line 65)

The path corresponding to the collection_id

mixed $depth (line 45)

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.

mixed $method (line 39)

The HTTP request method: PROPFIND, LOCK, REPORT, OPTIONS, etc...

mixed $options (line 29)
mixed $principal (line 50)

The 'principal' (user/resource/...) which this request seeks to access

mixed $raw_post (line 34)

The raw data sent along with the request

mixed $user_agent (line 55)

The user agent making the request.

Methods
Constructor CalDAVRequest (line 70)

Create a new CalDAVRequest object.

CalDAVRequest CalDAVRequest ([ $options = array()])
  • $options
AllowedTo (line 531)

Are we allowed to do the requested activity

+------------+------------------------------------------------------+ | METHOD | PRIVILEGES | +------------+------------------------------------------------------+ | MKCALENDAR | DAV:bind | | REPORT | DAV:read or CALDAV:read-free-busy (on all referenced | | | resources) | +------------+------------------------------------------------------+

void AllowedTo (string $activity)
  • string $activity: The activity we want to do.
DepthRegexTail (line 377)

Returns the tail of a Regex appropriate for this Depth, when appended to

void DepthRegexTail ()
DoResponse (line 610)

Utility function we call when we have a simple status-based response to return to the client. Possibly

void DoResponse (int $status, [string $message = ""], [ $content_type = "text/plain; charset=\"utf-8\""])
  • int $status: The HTTP status code to send.
  • string $message: The friendly text message to send with the response.
  • $content_type
FailIfLocked (line 456)

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.

  • return: false (no lock) or opaquelocktoken (opened lock)
mixed FailIfLocked ()
GetDepthName (line 368)

Returns the name for this depth: 0, 1, infinity

void GetDepthName ()
GetLockDetails (line 442)

Returns the DB object associated with a lock token, or false.

void GetLockDetails (string $lock_token)
  • string $lock_token: The opaquelocktoken which we are looking for
GetLockRow (line 388)

Returns the locked row, either from the cache or from the database

void GetLockRow ( $lock_token, string $dav_name)
  • string $dav_name: The resource which we want to know the lock status for
  • $lock_token
IsCollection (line 491)

Returns true if the URL referenced by this request points at a collection.

void IsCollection ()
IsInfiniteDepth (line 513)

Returns true if the request asked for infinite depth

void IsInfiniteDepth ()
IsLocked (line 336)

Checks whether the resource is locked, returning any lock token, or false

FIXME: This logic does not catch all locking scenarios. For example an infinite depth request should check the permissions for all collections and resources within that. At present we only maintain permissions on a per-collection basis though.

void IsLocked (string $dav_name)
  • string $dav_name: The resource which we want to know the lock status for
IsPrincipal (line 502)

Returns true if the URL referenced by this request points at a principal.

void IsPrincipal ()
setPermissions (line 285)

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 <user name> component which matches the logged on user then the request has read/write privileges
  4. otherwise we query the defined relationships between users and use the minimum privileges returned from that analysis.

void setPermissions (int $user_no)
  • int $user_no: The current user number
SupportedPrivileges (line 632)

Return an array of what the DAV privileges are that are supported

  • return: The supported privileges.
array SupportedPrivileges ()
UnsupportedRequest (line 575)

Sometimes it's a perfectly formed request, but we just don't do that :-(

void UnsupportedRequest (array $unsupported)
  • array $unsupported: An array of the properties we don't support.
UserFromPath (line 244)

Work out the user whose calendar we are accessing, based on elements of the path.

void UserFromPath ()
ValidateLockToken (line 414)

Checks to see whether the lock token given matches one of the ones handed in with the request.

void ValidateLockToken (string $lock_token)
  • string $lock_token: The opaquelocktoken which we are looking for
XMLResponse (line 595)

Send an XML Response. This function will never return.

void XMLResponse (int $status, XMLElement $xmltree)
  • int $status: The HTTP status to respond
  • XMLElement $xmltree: An XMLElement tree to be rendered

Documentation generated on Sun, 19 Oct 2008 21:25:39 +1300 by phpDocumentor 1.3.2