From efd93b85b9d1a7ddf98adaf1aa7b01c628064c49 Mon Sep 17 00:00:00 2001 From: Rob Ostensen Date: Fri, 9 Sep 2011 17:58:54 -0500 Subject: [PATCH 1/3] 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'))); From 56cb0a877cb8ac4443ab87b64eeba75833ebb1b4 Mon Sep 17 00:00:00 2001 From: Rob Ostensen Date: Mon, 12 Sep 2011 20:56:28 -0500 Subject: [PATCH 2/3] skip scheduling attendees with schedule-agent set to something other than server Signed-off-by: Rob Ostensen --- 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 8c71342e..a22f9314 100644 --- a/inc/caldav-PUT-functions.php +++ b/inc/caldav-PUT-functions.php @@ -339,6 +339,11 @@ function do_scheduling_requests( vCalendar $resource, $create ) { dbg_error_log( "PUT", "not delivering to owner" ); continue; } + $agent = $attendee->GetParameterValue('SCHDEULE-AGENT'); + if ( $agent && $agent != 'SERVER' ) { + dbg_error_log( "PUT", "not delivering to %s, schedule agent set to value other than server", $email ); + continue; + } $schedule_target = new Principal('email',$email); if ( $schedule_target->Exists() ) { $attendee_calendar = new WritableCollection(array('path' => $schedule_target->internal_url('schedule-default-calendar'))); From 6fff6639fc4762f98e31642a037e54acf5a55346 Mon Sep 17 00:00:00 2001 From: Rob Ostensen Date: Tue, 13 Sep 2011 15:45:23 -0500 Subject: [PATCH 3/3] add a check to the setup page for the php calendar extension Signed-off-by: Rob Ostensen --- htdocs/setup.php | 10 +++++++++- po/messages.pot | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/setup.php b/htdocs/setup.php index beb1522c..1e8030c1 100644 --- a/htdocs/setup.php +++ b/htdocs/setup.php @@ -78,6 +78,13 @@ function check_ldap() { return new CheckResult(isset($loaded_extensions['ldap'])); } +function check_calendar() { + global $phpinfo, $loaded_extensions; + + if (!function_exists('cal_days_in_month')) return new CheckResult(false); + return new CheckResult(isset($loaded_extensions['calendar'])); +} + function check_suhosin_server_strip() { global $loaded_extensions; @@ -239,7 +246,8 @@ function build_dependencies_table( ) { translate('PHP DateTime class') => 'check_datetime', translate('Suhosin "server.strip" disabled') => 'check_suhosin_server_strip', translate('PHP Magic Quotes GPC off') => 'check_magic_quotes_gpc', - translate('PHP Magic Quotes runtime off') => 'check_magic_quotes_runtime' + translate('PHP Magic Quotes runtime off') => 'check_magic_quotes_runtime', + translate('PHP calendar extension available') => 'check_calendar' ); if ( isset($c->authenticate_hook) && isset($c->authenticate_hook['call']) && $c->authenticate_hook['call'] == 'LDAP_check') { diff --git a/po/messages.pot b/po/messages.pot index f6876a9d..9187a873 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -754,6 +754,9 @@ msgstr "" msgid "PHP LDAP module available" msgstr "" +msgid "PHP calendar extension available" +msgstr "" + msgid "PHP Magic Quotes GPC off" msgstr ""