summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2009-05-28 14:26:36 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2009-05-28 14:26:36 (GMT)
commitd25a004eb1263add97cc1e7c669b803cf7b05a1d (patch)
tree75af99896777f9755c4a9d34db71b09a0e79dc00
parent3c629929424ceee8d3d58d20fd6462163dcd21db (diff)
downloadserver-d25a004eb1263add97cc1e7c669b803cf7b05a1d.tar.gz
Added functionality for anonymous
ics (iCal data) download.
-rw-r--r--kolab-webclient/ChangeLog5
-rw-r--r--kolab-webclient/kolab-webclient.spec2
-rw-r--r--kolab-webclient/webclient-kolab-conf.template7
-rw-r--r--patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch143
-rw-r--r--patches/horde-webmail/1.2.0/tg/series1
-rw-r--r--patches/horde-webmail/1.2.0/tg/t_kronolith_HK_GW_AnonymousiCalDownload.diff143
6 files changed, 300 insertions, 1 deletions
diff --git a/kolab-webclient/ChangeLog b/kolab-webclient/ChangeLog
index e1643e9..ab9751e 100644
--- a/kolab-webclient/ChangeLog
+++ b/kolab-webclient/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-28 Gunnar Wrobel <p@rdus.de>
+
+ * kolab-webclient.spec: Added functionality for anonymous
+ ics (iCal data) download.
+
2009-05-13 Gunnar Wrobel <p@rdus.de>
* kolab-webclient.spec:
diff --git a/kolab-webclient/kolab-webclient.spec b/kolab-webclient/kolab-webclient.spec
index a15df0f..81b367c 100644
--- a/kolab-webclient/kolab-webclient.spec
+++ b/kolab-webclient/kolab-webclient.spec
@@ -3,7 +3,7 @@
%define V_package kolab-webclient
%define V_year 2009
%define V_month 05
-%define V_day 13
+%define V_day 28
%define V_version 1.2.0
%define V_source_version 1.2
%define V_passwd_version 3.0.1
diff --git a/kolab-webclient/webclient-kolab-conf.template b/kolab-webclient/webclient-kolab-conf.template
index 4c64076..f0ab459 100644
--- a/kolab-webclient/webclient-kolab-conf.template
+++ b/kolab-webclient/webclient-kolab-conf.template
@@ -35,4 +35,11 @@ $conf['kolab']['imap']['server'] = '@@@fqdnhostname@@@';
$conf['kolab']['imap']['server'] = '@@@local_addr@@@';
@@@endif@@@
$conf['kolab']['imap']['maildomain'] = '@@@postfix-mydomain@@@';
+
+/* Credentials for a proxy user to allow quasi anonymous ICS access
+ * via kronolith/ics_kolab.php. You will need to create this user
+ * first.
+ */
+//$conf['ics']['default_user'] = 'proxy@@@@postfix-mydomain@@@';
+//$conf['ics']['default_pass'] = 'proxy';
?>
diff --git a/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch b/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch
index 2840fa5..ec1acf8 100644
--- a/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch
+++ b/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch
@@ -26916,6 +26916,149 @@ Author: Gunnar Wrobel <p@rdus.de>
Date: Thu Apr 23 13:45:14 2009 +0200
Allow to configurable LDAP attribute mapping.
+From: Gunnar Wrobel <p@rdus.de>
+Subject: [PATCH] t/kronolith/HK/GW/AnonymousiCalDownload
+
+This patch allows anonymous access via kronolith/ics_kolab.php by
+using a proxy user that needs to be given access to user calendars
+that should be exported anonymously.
+
+STATUS: HACK
+
+Signed-off-by: Gunnar Wrobel <p@rdus.de>
+
+---
+ horde-webmail/config/kolab.php | 4 ++
+ horde-webmail/kronolith/ics_kolab.php | 95 +++++++++++++++++++++++++++++++++
+ 2 files changed, 99 insertions(+), 0 deletions(-)
+
+diff --git a/horde-webmail/config/kolab.php b/horde-webmail/config/kolab.php
+index ed41da4..118788a 100644
+--- a/horde-webmail/config/kolab.php
++++ b/horde-webmail/config/kolab.php
+@@ -35,6 +35,10 @@ $conf['kolab']['imap']['server'] = 'localhost';
+ /* Primary mail domain of your Kolab server */
+ $conf['kolab']['imap']['maildomain'] = 'example.com';
+
++/* Credentials for a proxy user to allow quasi anonymous ICS access via kronolith/ics_kolab.php */
++//$conf['ics']['default_user'] = '';
++//$conf['ics']['default_pass'] = '';
++
+ if (file_exists(dirname(__FILE__) . '/kolab.local.php')) {
+ require(dirname(__FILE__) . '/kolab.local.php');
+ }
+diff --git a/horde-webmail/kronolith/ics_kolab.php b/horde-webmail/kronolith/ics_kolab.php
+new file mode 100644
+index 0000000..bb26d64
+--- /dev/null
++++ b/horde-webmail/kronolith/ics_kolab.php
+@@ -0,0 +1,95 @@
++<?php
++/**
++ * $Horde: kronolith/ics.php,v 1.5.2.10 2008/01/10 16:16:49 jan Exp $
++ *
++ * Copyright 1999-2008 The Horde Project (http://www.horde.org/)
++ *
++ * See the enclosed file COPYING for license information (GPL). If you
++ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
++ *
++ * @author Chuck Hagenbuch <chuck@horde.org>
++ */
++
++@define('AUTH_HANDLER', true);
++@define('HORDE_BASE', dirname(__FILE__) . '/..');
++require_once HORDE_BASE . '/lib/base.php';
++
++// We want to always generate UTF-8 iCalendar data.
++NLS::setCharset('UTF-8');
++
++// Determine which calendar to export.
++$calendar = Util::getFormData('c');
++if (empty($calendar) && !empty($_SERVER['PATH_INFO'])) {
++ $calendar = basename($_SERVER['PATH_INFO']);
++}
++
++// Authenticate.
++$auth = &Auth::singleton($conf['auth']['driver']);
++if (!isset($_SERVER['PHP_AUTH_USER'])) {
++ if (isset($conf['ics']['default_user'])
++ && isset($conf['ics']['default_pass'])) {
++ $user = $conf['ics']['default_user'];
++ $pass = $conf['ics']['default_pass'];
++ }
++} else {
++ $user = $_SERVER['PHP_AUTH_USER'];
++ $pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null;
++}
++
++if (!isset($user) || !$auth->authenticate($user, array('password' => $pass))) {
++ header('WWW-Authenticate: Basic realm="Kronolith iCalendar Interface"');
++ header('HTTP/1.0 401 Unauthorized');
++ echo '401 Unauthorized';
++ exit;
++}
++
++@define('KRONOLITH_BASE', dirname(__FILE__));
++require_once KRONOLITH_BASE . '/lib/base.php';
++require_once 'Horde/Cache.php';
++require_once 'Horde/iCalendar.php';
++
++$share = $kronolith_shares->getShare($calendar);
++if (is_a($share, 'PEAR_Error')) {
++ header('HTTP/1.0 400 Bad Request');
++ echo '400 Bad Request';
++ exit;
++}
++
++if (!$share->hasPermission(Auth::getAuth(), PERMS_READ)) {
++ header('WWW-Authenticate: Basic realm="Kronolith iCalendar Interface"');
++ header('HTTP/1.0 401 Unauthorized');
++ echo '401 Unauthorized';
++ exit;
++}
++
++$cache = &Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
++$key = 'kronolith.ics.' . $calendar;
++
++$ics = $cache->get($key, 360);
++if (!$ics) {
++ $kronolith_driver->open(urlencode($calendar));
++ $events = $kronolith_driver->listEvents();
++
++ $iCal = new Horde_iCalendar();
++ $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
++
++ foreach ($events as $id) {
++ $event = &$kronolith_driver->getEvent($id);
++ if (is_a($event, 'PEAR_Error')) {
++ continue;
++ }
++ $iCal->addComponent($event->toiCalendar($iCal));
++ }
++
++ $ics = $iCal->exportvCalendar();
++ $cache->set($key, $ics);
++}
++
++$browser->downloadHeaders($calendar . '.ics',
++ 'text/calendar; charset=' . NLS::getCharset(),
++ true,
++ strlen($ics));
++echo $ics;
++
++Auth::clearAuth();
++@session_destroy();
+--
+tg: (b5749f0..) t/kronolith/HK/GW/AnonymousiCalDownload (depends on: t/dimp/H/GW/AclView)
+--
+TOPGIT patch commit log
+=======================
+
+commit 0df1aefd621efbe8a2d7e306fbc79dace5760280
+Author: Gunnar Wrobel <p@rdus.de>
+Date: Thu May 28 12:42:44 2009 +0200
+
+ First version of the anonymous ics download patch.
diff -c a/horde-webmail/lib/Horde/Kolab/Storage/Folder.php b/horde-webmail/lib/Horde/Kolab/Storage/Folder.php
--- a/horde-webmail/lib/Horde/Kolab/Storage/Folder.php
+++ b/horde-webmail/lib/Horde/Kolab/Storage/Folder.php
diff --git a/patches/horde-webmail/1.2.0/tg/series b/patches/horde-webmail/1.2.0/tg/series
index 39d79a5..0530e06 100644
--- a/patches/horde-webmail/1.2.0/tg/series
+++ b/patches/horde-webmail/1.2.0/tg/series
@@ -70,3 +70,4 @@ t_imp_H_MS_bug7438.diff -p1
t_Kolab__Format_HK_GW_HandleEmptyXmlParserReturn.diff -p1
t_pear_HK_GW_AddNetLDAP2.diff -p1
t_Kolab__Server_HK_GW_MappableAttributes.diff -p1
+t_kronolith_HK_GW_AnonymousiCalDownload.diff -p1
diff --git a/patches/horde-webmail/1.2.0/tg/t_kronolith_HK_GW_AnonymousiCalDownload.diff b/patches/horde-webmail/1.2.0/tg/t_kronolith_HK_GW_AnonymousiCalDownload.diff
new file mode 100644
index 0000000..a87d547
--- /dev/null
+++ b/patches/horde-webmail/1.2.0/tg/t_kronolith_HK_GW_AnonymousiCalDownload.diff
@@ -0,0 +1,143 @@
+From: Gunnar Wrobel <p@rdus.de>
+Subject: [PATCH] t/kronolith/HK/GW/AnonymousiCalDownload
+
+This patch allows anonymous access via kronolith/ics_kolab.php by
+using a proxy user that needs to be given access to user calendars
+that should be exported anonymously.
+
+STATUS: HACK
+
+Signed-off-by: Gunnar Wrobel <p@rdus.de>
+
+---
+ horde-webmail/config/kolab.php | 4 ++
+ horde-webmail/kronolith/ics_kolab.php | 95 +++++++++++++++++++++++++++++++++
+ 2 files changed, 99 insertions(+), 0 deletions(-)
+
+diff --git a/horde-webmail/config/kolab.php b/horde-webmail/config/kolab.php
+index ed41da4..118788a 100644
+--- a/horde-webmail/config/kolab.php
++++ b/horde-webmail/config/kolab.php
+@@ -35,6 +35,10 @@ $conf['kolab']['imap']['server'] = 'localhost';
+ /* Primary mail domain of your Kolab server */
+ $conf['kolab']['imap']['maildomain'] = 'example.com';
+
++/* Credentials for a proxy user to allow quasi anonymous ICS access via kronolith/ics_kolab.php */
++//$conf['ics']['default_user'] = '';
++//$conf['ics']['default_pass'] = '';
++
+ if (file_exists(dirname(__FILE__) . '/kolab.local.php')) {
+ require(dirname(__FILE__) . '/kolab.local.php');
+ }
+diff --git a/horde-webmail/kronolith/ics_kolab.php b/horde-webmail/kronolith/ics_kolab.php
+new file mode 100644
+index 0000000..bb26d64
+--- /dev/null
++++ b/horde-webmail/kronolith/ics_kolab.php
+@@ -0,0 +1,95 @@
++<?php
++/**
++ * $Horde: kronolith/ics.php,v 1.5.2.10 2008/01/10 16:16:49 jan Exp $
++ *
++ * Copyright 1999-2008 The Horde Project (http://www.horde.org/)
++ *
++ * See the enclosed file COPYING for license information (GPL). If you
++ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
++ *
++ * @author Chuck Hagenbuch <chuck@horde.org>
++ */
++
++@define('AUTH_HANDLER', true);
++@define('HORDE_BASE', dirname(__FILE__) . '/..');
++require_once HORDE_BASE . '/lib/base.php';
++
++// We want to always generate UTF-8 iCalendar data.
++NLS::setCharset('UTF-8');
++
++// Determine which calendar to export.
++$calendar = Util::getFormData('c');
++if (empty($calendar) && !empty($_SERVER['PATH_INFO'])) {
++ $calendar = basename($_SERVER['PATH_INFO']);
++}
++
++// Authenticate.
++$auth = &Auth::singleton($conf['auth']['driver']);
++if (!isset($_SERVER['PHP_AUTH_USER'])) {
++ if (isset($conf['ics']['default_user'])
++ && isset($conf['ics']['default_pass'])) {
++ $user = $conf['ics']['default_user'];
++ $pass = $conf['ics']['default_pass'];
++ }
++} else {
++ $user = $_SERVER['PHP_AUTH_USER'];
++ $pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null;
++}
++
++if (!isset($user) || !$auth->authenticate($user, array('password' => $pass))) {
++ header('WWW-Authenticate: Basic realm="Kronolith iCalendar Interface"');
++ header('HTTP/1.0 401 Unauthorized');
++ echo '401 Unauthorized';
++ exit;
++}
++
++@define('KRONOLITH_BASE', dirname(__FILE__));
++require_once KRONOLITH_BASE . '/lib/base.php';
++require_once 'Horde/Cache.php';
++require_once 'Horde/iCalendar.php';
++
++$share = $kronolith_shares->getShare($calendar);
++if (is_a($share, 'PEAR_Error')) {
++ header('HTTP/1.0 400 Bad Request');
++ echo '400 Bad Request';
++ exit;
++}
++
++if (!$share->hasPermission(Auth::getAuth(), PERMS_READ)) {
++ header('WWW-Authenticate: Basic realm="Kronolith iCalendar Interface"');
++ header('HTTP/1.0 401 Unauthorized');
++ echo '401 Unauthorized';
++ exit;
++}
++
++$cache = &Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
++$key = 'kronolith.ics.' . $calendar;
++
++$ics = $cache->get($key, 360);
++if (!$ics) {
++ $kronolith_driver->open(urlencode($calendar));
++ $events = $kronolith_driver->listEvents();
++
++ $iCal = new Horde_iCalendar();
++ $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
++
++ foreach ($events as $id) {
++ $event = &$kronolith_driver->getEvent($id);
++ if (is_a($event, 'PEAR_Error')) {
++ continue;
++ }
++ $iCal->addComponent($event->toiCalendar($iCal));
++ }
++
++ $ics = $iCal->exportvCalendar();
++ $cache->set($key, $ics);
++}
++
++$browser->downloadHeaders($calendar . '.ics',
++ 'text/calendar; charset=' . NLS::getCharset(),
++ true,
++ strlen($ics));
++echo $ics;
++
++Auth::clearAuth();
++@session_destroy();
+--
+tg: (b5749f0..) t/kronolith/HK/GW/AnonymousiCalDownload (depends on: t/dimp/H/GW/AclView)
+--
+TOPGIT patch commit log
+=======================
+
+commit 0df1aefd621efbe8a2d7e306fbc79dace5760280
+Author: Gunnar Wrobel <p@rdus.de>
+Date: Thu May 28 12:42:44 2009 +0200
+
+ First version of the anonymous ics download patch.