Allow users to accept iTip invitations also if not listed as attendee (can be disabled by config)

This commit is contained in:
Thomas Bruederli 2013-11-06 12:43:37 +01:00
parent 750be9225f
commit 387db8ea1a
3 changed files with 17 additions and 2 deletions

View file

@ -825,7 +825,7 @@ class calendar extends rcube_plugin
$calendar_select = null; $calendar_select = null;
} }
if ($status == 'unknown') { if ($status == 'unknown' && !$this->rc->config->get('calendar_allow_itip_uninvited', true)) {
$html = html::div('rsvp-status', $this->gettext('notanattendee')); $html = html::div('rsvp-status', $this->gettext('notanattendee'));
$action = 'import'; $action = 'import';
} }
@ -2084,6 +2084,17 @@ class calendar extends rcube_plugin
$reply_sender = $attendee['email']; $reply_sender = $attendee['email'];
} }
} }
// add attendee with this user's default identity if not listed
if (!$reply_sender) {
$sender_identity = $this->rc->user->get_identity();
$event['attendees'][] = array(
'name' => $sender_identity['name'],
'email' => $sender_identity['email'],
'role' => 'OPT-PARTICIPANT',
'status' => strtoupper($status),
);
}
} }
// save to calendar // save to calendar

View file

@ -377,7 +377,7 @@ function rcube_calendar_ui(settings)
} }
} }
$('#event-rsvp')[(rsvp&&!organizer?'show':'hide')](); $('#event-rsvp')[(rsvp && !is_organizer(event) ? 'show' : 'hide')]();
$('#event-rsvp .rsvp-buttons input').prop('disabled', false).filter('input[rel='+rsvp+']').prop('disabled', true); $('#event-rsvp .rsvp-buttons input').prop('disabled', false).filter('input[rel='+rsvp+']').prop('disabled', true);
} }

View file

@ -107,6 +107,10 @@ $rcmail_config['calendar_categories'] = array(
// enable users to invite/edit attendees for shared events organized by others // enable users to invite/edit attendees for shared events organized by others
$rcmail_config['calendar_allow_invite_shared'] = false; $rcmail_config['calendar_allow_invite_shared'] = false;
// allow users to accecpt iTip invitations who are no explicitly listed as attendee.
// this can be the case if invitations are sent to mailing lists or alias email addresses.
$rcmail_config['calendar_allow_itip_uninvited'] = true;
// enable asynchronous free-busy triggering after data changed // enable asynchronous free-busy triggering after data changed
$rcmail_config['calendar_freebusy_trigger'] = false; $rcmail_config['calendar_freebusy_trigger'] = false;