File/inc/caldav-PUT-functions.php

Description

CalDAV Server - handle PUT method

Includes
 require_once ('WritableCollection.php') (line 19)
 require_once ('iCalendar.php') (line 18)

Check if the user wants to put just one VEVENT/VTODO or a whole calendar

if the collection = calendar = $request_container doesn't exist then create it return true if it's a whole calendar

Functions
controlRequestContainer (line 67)

Work out the location we are doing the PUT to, and check that we have the rights to do the needful.

void controlRequestContainer (string $username, int $user_no, string $path, boolean $caldav_context, [boolean $public = null])
  • string $username: The name of the destination user
  • int $user_no: The user making the change
  • string $path: The DAV path the resource is bing PUT to
  • boolean $caldav_context: Whether we are responding via CalDAV or interactively
  • boolean $public: Whether the collection will be public, should we need to create it
create_scheduling_requests (line 338)

Create scheduling requests in the schedule inbox for the

void create_scheduling_requests ( &$resource, iCalComponent $resource)
  • iCalComponent $resource: The VEVENT/VTODO/... resource we are scheduling
  • &$resource
handle_schedule_reply (line 251)

Deliver scheduling replies to organizer and other attendees

  • return: on error
false handle_schedule_reply (iCalComponent $ical)
  • iCalComponent $ical: the VCALENDAR to deliver
handle_schedule_request (line 165)

Deliver scheduling requests to attendees

void handle_schedule_request (iCalComponent $ical)
  • iCalComponent $ical: the VCALENDAR to deliver
import_collection (line 403)

This function will import a whole calendar

void import_collection (string $ics_content, int $user_no, string $path, boolean $caldav_context, [ $appending = false])
  • string $ics_content: the ics file to import
  • int $user_no: the user wich will receive this ics file
  • string $path: the $path where it will be store such as /user_foo/home/
  • boolean $caldav_context:

    Whether we are responding via CalDAV or interactively

    Any VEVENTs with the same UID will be concatenated together

  • $appending
public_events_only (line 141)

Check if this collection should force all events to be PUBLIC.

  • return: Return true if public events only are allowed.
boolean public_events_only (string $user_no, string $dav_name)
  • string $user_no: the user that owns the collection
  • string $dav_name: the collection to check
rollback_on_error (line 36)

This function launches an error

void rollback_on_error (boolean $caldav_context, int $user_no, string $path, [string $message = ''], [int $error_no = 500])
  • boolean $caldav_context: Whether we are responding via CalDAV or interactively
  • int $user_no: the user who will receive this ics file
  • string $path: the $path where the PUT failed to store such as /user_foo/home/
  • string $message: An optional error message to return to the client
  • int $error_no: An optional value for the HTTP error code
simple_write_resource (line 1006)

A slightly simpler version of write_resource which will make more sense for calling from an external program. This makes assumptions that the collection and user do exist and bypasses all checks for whether it is reasonable to write this here.

  • return: True for success, false for failure.
boolean simple_write_resource (string $path, string $caldav_data, string $put_action_type, [ $write_action_log = false])
  • string $path: The path to the resource being written
  • string $caldav_data: The actual resource to be written
  • string $put_action_type: INSERT or UPDATE depending on what we are to do
  • $write_action_log
update_scheduling_requests (line 368)

Update scheduling requests in the schedule inbox for the

void update_scheduling_requests ( &$resource, iCalComponent $resource)
  • iCalComponent $resource: The VEVENT/VTODO/... resource we are scheduling
  • &$resource
write_alarms (line 641)

Given a dav_id and an original iCalComponent, pull out each of the VALARMs and write the values into the calendar_alarm table.

null write_alarms (int $dav_id, iCalComponent $ical)
  • int $dav_id: The dav_id of the caldav_data we're processing
  • iCalComponent $ical: The VEVENT or VTODO containing the VALARM
write_attendees (line 690)

Parse out the attendee property and write a row to the calendar_attendee table for each one.

null write_attendees (int $dav_id, iCalComponent $ical)
  • int $dav_id: The dav_id of the caldav_data we're processing
  • iCalComponent $ical: The VEVENT or VTODO containing the ATTENDEEs
write_resource (line 739)

Actually write the resource to the database. All checking of whether this is reasonable should be done before this is called.

  • return: True for success, false for failure.
boolean write_resource (int $user_no, string $path, string $caldav_data, int $collection_id, int $author, string $etag, object $ic, string $put_action_type, boolean $caldav_context, [string $log_action = true], [string $weak_etag = null])
  • int $user_no: The user_no owning this resource on the server
  • string $path: The path to the resource being written
  • string $caldav_data: The actual resource to be written
  • int $collection_id: The ID of the collection containing the resource being written
  • int $author: The user_no who wants to put this resource on the server
  • string $etag: An etag unique for this event
  • object $ic: The parsed iCalendar object
  • string $put_action_type: INSERT or UPDATE depending on what we are to do
  • boolean $caldav_context: True, if we are responding via CalDAV, false for other ways of calling this
  • string $log_action: Either 'INSERT' or 'UPDATE': the type of action we are doing
  • string $weak_etag: An etag that is NOT modified on ATTENDEE changes for this event
write_scheduling_request (line 313)

Create a scheduling request in the schedule inbox for the

  • return: The result of the scheduling request, per caldav-sched #3.5.4
float write_scheduling_request ( &$resource,  $attendee_value,  $create_resource, iCalComponent $resource, iCalProp $attendee)
  • iCalComponent $resource: The VEVENT/VTODO/... resource we are scheduling
  • iCalProp $attendee: The attendee we are scheduling
  • &$resource
  • $attendee_value
  • $create_resource

Documentation generated on Tue, 28 Dec 2010 02:16:03 +1300 by phpDocumentor 1.4.3