From a4523dc7dd06e6681fd5c14b3a11d8bbf70110e8 Mon Sep 17 00:00:00 2001 From: Rob Ostensen Date: Fri, 9 Sep 2011 17:58:54 -0500 Subject: [PATCH] don't deliver to the current user when scheduling --- inc/caldav-PUT-functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php index fb2c8513..ed0ebfe3 100644 --- a/inc/caldav-PUT-functions.php +++ b/inc/caldav-PUT-functions.php @@ -316,6 +316,7 @@ function handle_schedule_reply ( vCalendar $ical ) { * @param boolean $create true if the scheduling requests are being created. */ function do_scheduling_requests( vCalendar $resource, $create ) { + global $request; if ( ! is_object($resource) ) { dbg_error_log( 'PUT', 'do_scheduling_requests called with non-object parameter (%s)', gettype($resource) ); return; @@ -332,6 +333,10 @@ function do_scheduling_requests( vCalendar $resource, $create ) { $schedule_request->AddProperty('METHOD','REQUEST'); foreach( $attendees AS $attendee ) { $email = preg_replace( '/^mailto:/i', '', $attendee->Value() ); + if ( $email == $request->principal->email() ) { + dbg_error_log( "PUT", "not delivering to owner" ); + continue; + } $schedule_target = new Principal('email',$email); if ( $schedule_target->Exists() ) { $attendee_calendar = new WritableCollection(array('path' => $schedule_target->internal_url('schedule-default-calendar')));