Scrub confidential events more thoroughly.

This commit is contained in:
Andrew McMillan 2007-11-04 23:30:51 +13:00
parent 601e7bc12f
commit 5f2a55bcf5
2 changed files with 14 additions and 8 deletions

View File

@ -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") );
}
?>

View File

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