From 50569114acdc64e7c7cae1498635d3f821517c30 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 7 Mar 2016 15:53:16 +0100 Subject: Initial commit of the Faster IT roundcube_calendar plugin distribution This includes: * Kolab plugins 3.2.9 (calendar and libcalendaring) * CalDAV driver 3.2.8 * .htaccess files for at least some security * SabreDAV updated to 1.8.12 (Jan 2015 release) * Support for CURLOPT_SSL_* settings to allow self-signed certificates * Small fixes & improved documentation --- .../SabreDAV/lib/OldSabre/CalDAV/Schedule/IMip.php | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 calendar/lib/SabreDAV/lib/OldSabre/CalDAV/Schedule/IMip.php (limited to 'calendar/lib/SabreDAV/lib/OldSabre/CalDAV/Schedule/IMip.php') diff --git a/calendar/lib/SabreDAV/lib/OldSabre/CalDAV/Schedule/IMip.php b/calendar/lib/SabreDAV/lib/OldSabre/CalDAV/Schedule/IMip.php new file mode 100644 index 0000000..5898917 --- /dev/null +++ b/calendar/lib/SabreDAV/lib/OldSabre/CalDAV/Schedule/IMip.php @@ -0,0 +1,111 @@ +senderEmail = $senderEmail; + + } + + /** + * Sends one or more iTip messages through email. + * + * @param string $originator Originator Email + * @param array $recipients Array of email addresses + * @param VObject\Component $vObject + * @param string $principal Principal Url of the originator + * @return void + */ + public function sendMessage($originator, array $recipients, VObject\Component $vObject, $principal) { + + foreach($recipients as $recipient) { + + $to = $recipient; + $replyTo = $originator; + $subject = 'SabreDAV iTIP message'; + + switch(strtoupper($vObject->METHOD)) { + case 'REPLY' : + $subject = 'Response for: ' . $vObject->VEVENT->SUMMARY; + break; + case 'REQUEST' : + $subject = 'Invitation for: ' .$vObject->VEVENT->SUMMARY; + break; + case 'CANCEL' : + $subject = 'Cancelled event: ' . $vObject->VEVENT->SUMMARY; + break; + } + + $headers = array(); + $headers[] = 'Reply-To: ' . $replyTo; + $headers[] = 'From: ' . $this->senderEmail; + $headers[] = 'Content-Type: text/calendar; method=' . (string)$vObject->method . '; charset=utf-8'; + if (DAV\Server::$exposeVersion) { + $headers[] = 'X-Sabre-Version: ' . DAV\Version::VERSION . '-' . DAV\Version::STABILITY; + } + + $vcalBody = $vObject->serialize(); + + $this->mail($to, $subject, $vcalBody, $headers); + + } + + } + + // @codeCoverageIgnoreStart + // This is deemed untestable in a reasonable manner + + /** + * This function is reponsible for sending the actual email. + * + * @param string $to Recipient email address + * @param string $subject Subject of the email + * @param string $body iCalendar body + * @param array $headers List of headers + * @return void + */ + protected function mail($to, $subject, $body, array $headers) { + + + mail($to, $subject, $body, implode("\r\n", $headers)); + + } + + // @codeCoverageIgnoreEnd + +} -- cgit v1.2.3