diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 2ce4f7f8..a42bd3e1 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -1732,6 +1732,18 @@ class calendar extends rcube_plugin $settings['identity'] = array('name' => $identity['name'], 'email' => strtolower($identity['email']), 'emails' => ';' . strtolower(join(';', $identity['emails']))); } + // freebusy token authentication URL + if (($url = $this->rc->config->get('calendar_freebusy_session_auth_url')) + && ($uniqueid = $this->rc->config->get('kolab_uniqueid')) + ) { + if ($url === true) $url = '/freebusy'; + $url = rtrim(rcube_utils::resolve_url($url), '/ '); + $url .= '/' . urlencode($this->rc->get_user_name()); + $url .= '/' . urlencode($uniqueid); + + $settings['freebusy_url'] = $url; + } + return $settings; } diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js index 68661a77..8690882a 100644 --- a/plugins/calendar/calendar_ui.js +++ b/plugins/calendar/calendar_ui.js @@ -3200,6 +3200,27 @@ function rcube_calendar_ui(settings) } }; + // show free-busy URL in a dialog box + this.showfburl = function() + { + var $dialog = $('#fburlbox'); + + if ($dialog.is(':ui-dialog')) + $dialog.dialog('close'); + + $dialog.dialog({ + resizable: true, + closeOnEscape: true, + title: rcmail.gettext('showfburl', 'calendar'), + close: function() { + $dialog.dialog("destroy").hide(); + }, + width: 520 + }).show(); + + $('#fburl').val(settings.freebusy_url).select(); + }; + // refresh the calendar view after saving event data this.refresh = function(p) { @@ -3601,7 +3622,7 @@ function rcube_calendar_ui(settings) calendars_list.addEventListener('select', function(node) { if (node && node.id && me.calendars[node.id]) { me.select_calendar(node.id, true); - rcmail.enable_command('calendar-edit', 'calendar-showurl', true); + rcmail.enable_command('calendar-edit', 'calendar-showurl', 'calendar-showfburl', true); rcmail.enable_command('calendar-delete', me.calendars[node.id].editable); rcmail.enable_command('calendar-remove', me.calendars[node.id] && me.calendars[node.id].removable); } @@ -4162,6 +4183,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { rcmail.register_command('calendar-delete', function(){ cal.calendar_delete(cal.calendars[cal.selected_calendar]); }, false); rcmail.register_command('events-import', function(){ cal.import_events(cal.calendars[cal.selected_calendar]); }, true); rcmail.register_command('calendar-showurl', function(){ cal.showurl(cal.calendars[cal.selected_calendar]); }, false); + rcmail.register_command('calendar-showfburl', function(){ cal.showfburl(); }, false); rcmail.register_command('event-download', function(){ cal.event_download(cal.selected_event); }, true); rcmail.register_command('event-sendbymail', function(p, obj, e){ cal.event_sendbymail(cal.selected_event, e); }, true); rcmail.register_command('event-copy', function(){ cal.event_copy(cal.selected_event); }, true); diff --git a/plugins/calendar/config.inc.php.dist b/plugins/calendar/config.inc.php.dist index 83864edd..3d91e2d9 100644 --- a/plugins/calendar/config.inc.php.dist +++ b/plugins/calendar/config.inc.php.dist @@ -166,4 +166,9 @@ $config['kolab_invitation_calendars'] = false; // LDAP directory configuration to find avilable resources for events // $config['calendar_resources_directory'] = array(/* ldap_public-like address book configuration */); +// Enables displaying of free-busy URL with token-based authentication +// Set it to the prefix URL, e.g. 'https://hostname/freebusy' or just '/freebusy'. +// See freebusy_session_auth in configuration of kolab_auth plugin. +$calendar['calendar_freebusy_session_auth_url'] = null; + ?> diff --git a/plugins/calendar/localization/en_US.inc b/plugins/calendar/localization/en_US.inc index 496b1e5c..ebbd3e47 100644 --- a/plugins/calendar/localization/en_US.inc +++ b/plugins/calendar/localization/en_US.inc @@ -112,6 +112,8 @@ $labels['nmonthsback'] = '$nr months back'; $labels['showurl'] = 'Show calendar URL'; $labels['showurldescription'] = 'Use the following address to access (read only) your calendar from other applications. You can copy and paste this into any calendar software that supports the iCal format.'; $labels['caldavurldescription'] = 'Copy this address to a CalDAV client application (e.g. Evolution or Mozilla Thunderbird) to fully synchronize this specific calendar with your computer or mobile device.'; +$labels['showfburl'] = 'Show free-busy URL'; +$labels['fburldescription'] = 'Use the following address to access Free-Busy information from other applications. You can copy and paste this into any calendar software that supports free-busy information in iCal format. No authentication is required for this URL.'; $labels['findcalendars'] = 'Find calendars...'; $labels['searchterms'] = 'Search terms'; $labels['calsearchresults'] = 'Available Calendars'; diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css index 74da6c31..b21f3d4f 100644 --- a/plugins/calendar/skins/larry/calendar.css +++ b/plugins/calendar/skins/larry/calendar.css @@ -433,6 +433,7 @@ pre { background-color: #c7e3ef; } +#fburl, #calfeedurl, #caldavurl { width: 98%; diff --git a/plugins/calendar/skins/larry/templates/calendar.html b/plugins/calendar/skins/larry/templates/calendar.html index e7f89c26..07a4750d 100644 --- a/plugins/calendar/skins/larry/templates/calendar.html +++ b/plugins/calendar/skins/larry/templates/calendar.html @@ -74,6 +74,9 @@