From 5f2a55bcf5bc779037328352e5008c35b4bdde01 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 4 Nov 2007 23:30:51 +1300 Subject: [PATCH] Scrub confidential events more thoroughly. --- inc/caldav-GET.php | 11 +++++++---- inc/caldav-REPORT.php | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/inc/caldav-GET.php b/inc/caldav-GET.php index e2b1bb57..123f5834 100644 --- a/inc/caldav-GET.php +++ b/inc/caldav-GET.php @@ -61,9 +61,13 @@ else if ( $qry->rows > 1 ) { // the user is not admin / owner of this calendarlooking at his calendar and can not admin the other cal if ( $event->class == 'CONFIDENTIAL' ) { // if the event is confidential we fake one that just says "Busy" - $displayname = translate("Busy"); - $ical->Put( 'SUMMARY', $displayname ); - $response .= $ical->Render( false, $event->caldav_type, $ical->DefaultPropertyList() ); + $confidential = new iCalendar( array( + 'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL', + 'DTSTART' => $ical->Get('DTSTART'), + 'DURATION' => $ical->Get('DURATION'), + 'RRULE' => $ical->Get('RRULE') + ) ); + $response .= $confidential->Render( false, $event->caldav_type ); } elseif ( $c->hide_alarm ) { // Otherwise we hide the alarms (if configured to) @@ -89,4 +93,3 @@ else { $request->DoResponse( 500, translate("Database Error") ); } -?> \ No newline at end of file diff --git a/inc/caldav-REPORT.php b/inc/caldav-REPORT.php index 02c7abd1..7df75582 100644 --- a/inc/caldav-REPORT.php +++ b/inc/caldav-REPORT.php @@ -72,10 +72,13 @@ function calendar_to_xml( $properties, $item ) { // the user is not admin / owner of this calendarlooking at his calendar and can not admin the other cal if ( $item->class == 'CONFIDENTIAL' ) { // if the event is confidential we fake one that just says "Busy" - $displayname = translate("Busy"); - $ical = new iCalendar( array( "icalendar" => $caldav_data) ); - $ical->Put( 'SUMMARY', $displayname ); - $caldav_data = $ical->render(true, $caldav_type, $ical->DefaultPropertyList() ); + $confidential = new iCalendar( array( + 'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL', + 'DTSTART' => $ical->Get('DTSTART'), + 'DURATION' => $ical->Get('DURATION'), + 'RRULE' => $ical->Get('RRULE') + ) ); + $caldav_data = $confidential->Render( true, $caldav_type ); } elseif ( $c->hide_alarm ) { // Otherwise we hide the alarms (if configured to)