plugins/calendar

Thomas Brüderli bruederli at kolabsys.com
Wed Nov 6 12:45:16 CET 2013


 plugins/calendar/calendar.php        |   13 ++++++++++++-
 plugins/calendar/calendar_ui.js      |    2 +-
 plugins/calendar/config.inc.php.dist |    4 ++++
 3 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 387db8ea1a8362b97d78d206e32bde69fed135ca
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Nov 6 12:43:37 2013 +0100

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

diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 97ec1b1..d9db4e1 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -825,7 +825,7 @@ class calendar extends rcube_plugin
             $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'));
           $action = 'import';
         }
@@ -2084,6 +2084,17 @@ class calendar extends rcube_plugin
             $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
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 4a633eb..20fa330 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -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);
       }
 
diff --git a/plugins/calendar/config.inc.php.dist b/plugins/calendar/config.inc.php.dist
index 449041c..4ec3c08 100644
--- a/plugins/calendar/config.inc.php.dist
+++ b/plugins/calendar/config.inc.php.dist
@@ -107,6 +107,10 @@ $rcmail_config['calendar_categories'] = array(
 // enable users to invite/edit attendees for shared events organized by others
 $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
 $rcmail_config['calendar_freebusy_trigger'] = false;
 




More information about the commits mailing list