3 * Allows logging of CalDAV actions (PUT/DELETE) for possible export or sync
4 * through some other glue.
9 * @author Andrew McMillan <andrew@morphoss.com>
10 * @copyright Morphoss Ltd
11 * @license http://gnu.org/copyleft/gpl.html GNU GPL v2
13 * This file is intended to be used as a template, perhaps the user of this service
14 * will want to log actions in a very different manner and this can be used as an
15 * example of how to go about doing that.
20 * @param string $action_type INSERT / UPDATE or DELETE
21 * @param string $uid The UID of the modified item
22 * @param integer $user_no The user owning the containing collection.
23 * @param integer $collection_id The ID of the containing collection.
24 * @param string $dav_name The DAV path of the item, relative to the DAViCal base path
26 function log_caldav_action( $action_type, $uid, $user_no, $collection_id, $dav_name ) {
29 $logline = sprintf( '%s %s %s %s %s %s', gmdate('Ymd\THis\Z'), $action_type, $uid, $user_no, $collection_id, $dav_name );
30 if ( !isset($c->action_log_name
) ) {
31 error_log( $logline );
37 $logfile = fopen( $c->action_log_name
, "a+" );
38 fwrite( $logfile, $logline );