## /inc/caldav-PUT-functions.php

Description

CalDAV Server - handle PUT method

- author: Andrew McMillan <andrew@morphoss.com>
- copyright: Morphoss Ltd - http://www.morphoss.com/
- license: GNU GPL v2 or later version

Includes
include_once ('iSchedule.php') (line 22)
include_once ('RRule-v2.php') (line 23)
require_once ('vComponent.php') (line 19)
require_once ('WritableCollection.php') (line 21)
require_once ('AwlCache.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

require_once ('vCalendar.php') (line 20)
Functions
controlRequestContainer (line 71)

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

do_scheduling_reply (line 324)

Do the scheduling adjustments for a REPLY when an ATTENDEE updates their status.

void do_scheduling_reply ( $resource, $organizer)

- vCalendar $resource: The resource that the ATTENDEE is writing to their calendar
- string $organizer: The property which is the event ORGANIZER.

do_scheduling_requests (line 485)

Create/Update the scheduling requests for this resource. This includes updating the scheduled user's default calendar.

- return: If there was any scheduling action

true do_scheduling_requests ( $resource, boolean $create, [ $old_data = null])

- vComponent $resource: The VEVENT/VTODO/... resource we are scheduling
- boolean $create: true if the scheduling requests are being created.
- $old_data

GetTZID (line 173)

Get a TZID string from this VEVENT/VTODO/... component if we can

- return: TZID value we found, or null

The GetTZID ( $comp)

- vComponent $comp

handle_schedule_reply (line 275)

Deliver scheduling replies to organizer and other attendees

- return: on error

false handle_schedule_reply ( $ical)

- vComponent $ical: the VCALENDAR to deliver

handle_schedule_request (line 186)

Deliver scheduling requests to attendees

void handle_schedule_request (vComponent $ical)

- vComponent $ical: the VCALENDAR to deliver

import_addressbook_collection (line 682)

This function will import a whole calendar

void import_addressbook_collection ( $vcard_content, int $user_no, string $path, boolean $caldav_context, [ $appending = false], string $ics_content)

- 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

- $vcard_content
- $appending

import_calendar_collection (line 779)

This function will import a whole calendar

void import_calendar_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

import_collection (line 646)

This function will import a whole collection

void import_collection ( $import_content, int $user_no, string $path, boolean $caldav_context, [ $appending = false], string $ics_content)

- 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

  The work is either done by

- $import_content
- $appending

public_events_only (line 149)

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 40)

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 1459)

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

write_alarms (line 1058)

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

null write_alarms (int $dav_id, $ical)

- int $dav_id: The dav_id of the caldav_data we're processing
- vComponent $ical: The VEVENT or VTODO containing the VALARM

write_attendees (line 1120)

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

null write_attendees (int $dav_id, $ical)

- int $dav_id: The dav_id of the caldav_data we're processing
- vComponent $ical: The VEVENT or VTODO containing the ATTENDEEs

write_resource (line 1169)

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 (DAVResource $resource, string $caldav_data, DAVResource $collection, int $author, &$etag, string $put_action_type, boolean $caldav_context, [string $log_action = true], [string $weak_etag = null], string $etag)

- DAVResource $resource: The resource being written
- string $caldav_data: The actual data to be written
- DAVResource $collection: 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
- 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
- &$etag

Documentation generated on Sun, 08 Jul 2012 12:53:47 +0000 by phpDocumentor 1.4.3