From cvs at kolab.org Fri Oct 2 12:50:02 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 2 Oct 2009 12:50:02 +0200 (CEST) Subject: thomas: doc/www/src/security kolab-vendor-notice-24.txt,NONE,1.1 Message-ID: <20091002105002.EEB3F600815@lists.intevation.de> Author: thomas Update of /kolabrepository/doc/www/src/security In directory doto:/tmp/cvs-serv21287 Added Files: kolab-vendor-notice-24.txt Log Message: Kolab Security Issue 24 20091002 (imapd) --- NEW FILE: kolab-vendor-notice-24.txt --- -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kolab Security Issue 24 20091002 ================================ Package: Kolab Server, Cyrus IMAP Server Vulnerability: various Kolab Specific: no Dependent Packages: none Summary ~~~~~~~ The Cyrus IMAP mail server supports the SIEVE mail filtering language. Cyrus IMAP versions 2.2 through 2.3.14 contain a buffer overflow vulnerability that may be triggered by a specially crafted SIEVE script. To install this type of script, the attacker would need to have direct access to a mail account on the server. Affected Versions ~~~~~~~~~~~~~~~~~ This affects versions of Cyrus IMAP Server up to version 2.3.14 Kolab Server 2.2.2 and previous releases are affected. Fix ~~~ Upgrade Cyrus IMAP Server to imapd-2.3.13-20081020_kolab3, which includes a patch to fix the problem. OpenPKG packages for Kolab Server 2.2.2 are available from http://files.kolab.org/server/security-updates/20091002/ or from the mirrors listed on http://kolab.org/mirrors.html A binary RPM for Kolab Server 2.2.2 (ix86 Debian GNU/Linux Lenny) is available as imapd-2.3.13-20081020_kolab3.ix86-debian5.0-kolab.rpm A binary RPM for Kolab Server 2.2.2 (ix86 Debian GNU/Linux Etch) is available as imapd-2.3.13-20081020_kolab3.ix86-debian4.0-kolab.rpm Above source and binary packages have been verified to work with Kolab Server 2.2.0, so you can upgrade the imapd package without doing a full upgrade. All other server versions: Please upgrade to Kolab Server 2.2.x and install the updated imapd package. You can check the integrity of the downloaded files with: $ gpg --keyserver keys.gnupg.net --recv-key 5816791A or import the key from https://www.intevation.de/~thomas/gpg_pub_key.asc $ gpg --verify SHA1SUMS.sig $ sha1sum -c SHA1SUMS The source package can be compiled and installed on your Kolab Server with: # su - kolab $ openpkg rpm --rebuild --define 'with_fsl yes' --define 'with_group yes' \ --define 'with_group_igncase yes' --define 'with_atvdom yes' \ --define 'with_ldap yes' --define 'with_annotate yes' \ --define 'with_morelogging yes' --define 'with_kolab yes' \ --define 'with_kolab_nocaps yes' \ ...path/to.../imapd-2.3.13-20081020_kolab3.src.rpm $ openpkg rpm \ -Uvh /kolab/RPM/PKG/imapd-2.3.13-20081020_kolab3.--kolab.rpm To install a binary package, just skip the rebuild step: # su - kolab $ openpkg rpm \ -Uvh ...path/to.../imapd-2.3.13-20081020_kolab3.--kolab.rpm Alternatively you can copy or symlink all source and binary rpms and install-kolab.sh of your current installation and the source rpm of this security advisory into a new directory and follow the instructions below "Generating your own 00INDEX.rdf for installations or upgrades" in 1st.README to generate a new installer which can be used to compile and install the new package without having to specify the "--define" options. Details ~~~~~~~ http://lists.andrew.cmu.edu/pipermail/cyrus-announce/2009-September/000068.html Cyrus IMAPd 2.2.13p1 & 2.3.15 Released https://lists.andrew.cmu.edu/pipermail/cyrus-cvs/2009-September/001253.html https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/sieve/script.c.diff?r1=1.67&r2=1.68 Upstream patch for src/sieve/script.c by Bron Gondwana http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2632 CVE-2009-2632 Timeline ~~~~~~~~ 20090909 Cyrus IMAPd 2.2.13p1 & 2.3.15 released. 20090922 Fix available via Kolab CVS, started testing. 20091002 Kolab Server security advisory published. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkrF2pYACgkQW7P1GVgWeRr/9ACfTitATIM40tEJ+z66Awe5HrXX upMAn2opjdaimN5H+YN/H/NnQbaUAntm =cZj0 -----END PGP SIGNATURE----- From cvs at kolab.org Fri Oct 2 15:06:16 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 2 Oct 2009 15:06:16 +0200 (CEST) Subject: thomas: doc/www/src index.html.m4,1.165,1.166 Message-ID: <20091002130616.1890E600818@lists.intevation.de> Author: thomas Update of /kolabrepository/doc/www/src In directory doto:/tmp/cvs-serv30359 Modified Files: index.html.m4 Log Message: Security Issue 24 for Kolab Server (imapd) on index page Index: index.html.m4 =================================================================== RCS file: /kolabrepository/doc/www/src/index.html.m4,v retrieving revision 1.165 retrieving revision 1.166 diff -u -d -r1.165 -r1.166 --- index.html.m4 26 Jun 2009 10:54:46 -0000 1.165 +++ index.html.m4 2 Oct 2009 13:06:13 -0000 1.166 @@ -59,6 +59,21 @@
+ + +
October 2nd, 2009» + Security Issue 24 for Kolab Server (imapd) +
+
+ A new imapd RPM with a fix for + CVE-2009-2632 + is available. See the + Kolab Security Issue 24 for details. +
+

+ + +'; + } + $html .= ''; + $olddayname = $dayname; + $firstday = false; + } + + if (in_array($event->getId(), $displayed)) { + continue; + } + + $category = $event->getCategory(); + if (!empty($category)) { + $ctd = '' . $ctd . ''; + + $html .= '' . $ctd . ''; + + $totalevents++; + + $displayed[] = $event->getId(); + } + } + + if (empty($html)) { + return '' . _("No events to display") . ''; + } + + return '
June 26th, 2009 » Kontact for Windows 20090605-7 (beta) released From cvs at kolab.org Wed Oct 7 23:01:48 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Wed, 7 Oct 2009 23:01:48 +0200 (CEST) Subject: gunnar: server/kolab-webclient ChangeLog, 1.10.2.3.2.4, 1.10.2.3.2.5 Makefile, 1.6.4.5, 1.6.4.6 kolab-webclient.spec, 1.23.2.6.2.16, 1.23.2.6.2.17 Message-ID: <20091007210148.68F0760014A@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv8377/kolab-webclient Modified Files: Tag: suc_branch ChangeLog Makefile kolab-webclient.spec Log Message: Added functionality for anonymous java script based export of calendar data. Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.3.2.4 retrieving revision 1.10.2.3.2.5 diff -u -d -r1.10.2.3.2.4 -r1.10.2.3.2.5 --- ChangeLog 28 May 2009 14:26:36 -0000 1.10.2.3.2.4 +++ ChangeLog 7 Oct 2009 21:01:46 -0000 1.10.2.3.2.5 @@ -1,3 +1,8 @@ +2009-10-07 Gunnar Wrobel

+ + * kolab-webclient.spec: Added functionality for anonymous + java script based export of calendar data. + 2009-05-28 Gunnar Wrobel

* kolab-webclient.spec: Added functionality for anonymous Index: Makefile =================================================================== RCS file: /kolabrepository/server/kolab-webclient/Makefile,v retrieving revision 1.6.4.5 retrieving revision 1.6.4.6 diff -u -d -r1.6.4.5 -r1.6.4.6 --- Makefile 26 Jun 2009 13:23:09 -0000 1.6.4.5 +++ Makefile 7 Oct 2009 21:01:46 -0000 1.6.4.6 @@ -26,7 +26,7 @@ VERSION = $(shell grep "%define[ ]*V_version" *.spec | sed -e "s/.*V_version\s*\([0-9._a-z]*\).*/\1/") SOURCE_VERSION = $(shell grep "%define[ ]*V_source_version" *.spec | sed -e "s/.*V_source_version\s*\([0-9._a-z-]*\).*/\1/") PASSWD_VERSION = $(shell grep "%define[ ]*V_passwd_version" *.spec | sed -e "s/.*V_passwd_version\s*\([0-9._a-z]*\).*/\1/") -RELEASE = ${YEAR}${MONTH}${DAY}suc03 +RELEASE = ${YEAR}${MONTH}${DAY}suc01 PATCHES = ../patches/horde-webmail/$(VERSION)/horde-webmail-$(VERSION)_kolab_openpkg.patch TEMPLATES = $(shell find . -name "*.template") Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.6.2.16 retrieving revision 1.23.2.6.2.17 diff -u -d -r1.23.2.6.2.16 -r1.23.2.6.2.17 --- kolab-webclient.spec 26 Jun 2009 13:23:09 -0000 1.23.2.6.2.16 +++ kolab-webclient.spec 7 Oct 2009 21:01:46 -0000 1.23.2.6.2.17 @@ -2,13 +2,13 @@ %define V_horde_name horde-webmail %define V_package kolab-webclient %define V_year 2009 -%define V_month 06 -%define V_day 26 +%define V_month 10 +%define V_day 07 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 %define V_date %{V_year}-%{V_month}-%{V_day} -%define V_release %{V_year}%{V_month}%{V_day}suc03 +%define V_release %{V_year}%{V_month}%{V_day}suc01 # Package Information Name: %{V_package} From cvs at kolab.org Wed Oct 7 23:01:49 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Wed, 7 Oct 2009 23:01:49 +0200 (CEST) Subject: gunnar: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_GW_ExportEventList.diff, NONE, 1.1.2.1 series, 1.5.2.3.2.3, 1.5.2.3.2.4 Message-ID: <20091007210149.256E660014A@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv8377/patches/horde-webmail/1.2.0/tg Modified Files: Tag: suc_branch series Added Files: Tag: suc_branch t_kronolith_HK_GW_ExportEventList.diff Log Message: Added functionality for anonymous java script based export of calendar data. --- NEW FILE: t_kronolith_HK_GW_ExportEventList.diff --- From: Gunnar Wrobel

Subject: [PATCH] t/kronolith/HK/GW/ExportEventList Export a list of events. STATUS: OPEN Signed-off-by: Gunnar Wrobel

--- horde-webmail/kronolith/imple_kolab.php | 92 +++++++++ horde-webmail/kronolith/lib/Block/eventlist.php | 243 +++++++++++++++++++++++ horde-webmail/kronolith/themes/embed.css | 51 +++++- horde-webmail/lib/Horde/Kolab/Storage/List.php | 2 +- 4 files changed, 386 insertions(+), 2 deletions(-) diff --git a/horde-webmail/kronolith/imple_kolab.php b/horde-webmail/kronolith/imple_kolab.php new file mode 100644 index 0000000..f18d2ad --- /dev/null +++ b/horde-webmail/kronolith/imple_kolab.php @@ -0,0 +1,92 @@ + + */ +if (!defined('HORDE_BASE')) { + define('HORDE_BASE', dirname(__FILE__) . '/..'); +} + +/* Load the Horde Framework core, and set up inclusion paths. */ +require_once HORDE_BASE . '/lib/core.php'; + + at define('AUTH_HANDLER', true); +/* Registry. */ +$session_control = 'none'; +$registry = &Registry::singleton(HORDE_SESSION_NONE); + +$auth = &Auth::singleton($conf['auth']['driver']); + +if (isset($conf['ics']['default_user']) + && isset($conf['ics']['default_pass'])) { + $user = $conf['ics']['default_user']; + $pass = $conf['ics']['default_pass']; + $auth->authenticate($user, + array('password' => + $pass)); +} + + at define('KRONOLITH_BASE', dirname(__FILE__)); +require_once KRONOLITH_BASE . '/lib/base.php'; +require_once KRONOLITH_BASE . '/lib/Imple.php'; + + +$path = Util::getFormData('imple'); +if (!$path) { + exit; +} +if ($path[0] == '/') { + $path = substr($path, 1); +} +$path = explode('/', $path); +$impleName = array_shift($path); + +$imple = Imple::factory($impleName); +if (!$imple) { + exit; +} + +$args = array(); +foreach ($path as $pair) { + if (strpos($pair, '=') === false) { + $args[$pair] = true; + } else { + list($name, $val) = explode('=', $pair); + $args[$name] = $val; + } +} + +$result = $imple->handle($args); + +if (!empty($_SERVER['Content-Type'])) { + $ct = $_SERVER['Content-Type']; +} else { + $ct = is_string($result) ? 'plain' : 'json'; +} + +switch ($ct) { +case 'json': + header('Content-Type: text/x-json'); + require_once KRONOLITH_BASE . '/lib/JSON.php'; + echo Kronolith_Serialize_JSON::encode(String::convertCharset($result, NLS::getCharset(), 'utf-8')); + break; + +case 'plain': + header('Content-Type: text/plain'); + echo $result; + break; + +case 'html': + header('Content-Type: text/html'); + echo $result; + break; + +default: + echo $result; +} diff --git a/horde-webmail/kronolith/lib/Block/eventlist.php b/horde-webmail/kronolith/lib/Block/eventlist.php new file mode 100644 index 0000000..420a984 --- /dev/null +++ b/horde-webmail/kronolith/lib/Block/eventlist.php @@ -0,0 +1,243 @@ + array('name' => _("Days"), + 'type' => 'int', + 'default' => 42), + 'maxevents' => array('name' => _("Maximum number of events to display (0 = no limit)"), + 'type' => 'int', + 'default' => 0)); + + return $params; + } + + /** + * The title to go in this block. + * + * @return string The title text. + */ + function _title() + { + global $registry; + return ''; + } + + /** + * The content to go in this block. + * + * @return string The content + */ + function _content() + { + global $kronolith_driver, $registry, $prefs; + require_once dirname(__FILE__) . '/../base.php'; + require_once KRONOLITH_BASE . '/lib/Day.php'; + require_once 'Horde/Prefs/CategoryManager.php'; + require_once 'Horde/Text/Filter.php'; + + if (!empty($this->_params['days'])) { + $span = $this->_params['days']; + } else { + $span = 42; + } + + $now = $_SERVER['REQUEST_TIME']; + $today = date('j'); + + $startDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j'))); + $endDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j') + $span)); + $endDate->correct(); + + if (isset($this->_params['calendar']) && + $this->_params['calendar'] != '__all') { + + $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']); + if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) { + return _("Permission Denied"); + } + + $all_events = Kronolith::listEvents($startDate, + $endDate, + array($this->_params['calendar'])); + } else { + $calendars = Kronolith::listCalendars(false, PERMS_SHOW); + $all_events = Kronolith::listEvents($startDate, + $endDate, + array_keys($calendars)); + } + if (is_a($all_events, 'PEAR_Error')) { + return '' . $all_events->getMessage() . ''; + } + + $iMax = $today + $span; + + $html = ''; + $firstday = true; + $olddayname = ''; + $totalevents = 0; + + $displayed = array(); + + for ($i = $today; $i < $iMax; ++$i) { + $day = new Kronolith_Day(date('n'), $i); + + if ($day->isToday()) { + $dayname = _("Today"); + } elseif ($day->isTomorrow()) { + $dayname = _("Tomorrow"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear()) { + $dayname = _("This week"); + } elseif ($day->month == $startDate->month) { + if ($day->weekOfYear() == $startDate->weekOfYear() + 1) { + $dayname = _("Next week"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 2) { + $dayname = _("Two weeks from now"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 3) { + $dayname = _("Three weeks from now"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 4) { + $dayname = _("Four weeks from now"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 5) { + $dayname = _("Five weeks from now"); + } + } elseif ($day->month - 1 == $startDate->month + || ($day->month == 1 && $startDate->month == 12)) { + $dayname = _("Next month"); + } elseif ($day->year == $startDate->year) { + $dayname = $day->format('F'); + } elseif ($day->year - 1 == $startDate->year) { + $dayname = _("Next year"); + } else { + $dayname = _("After the next year"); + } + + if (empty($all_events[$day->getStamp()])) { + continue; + } + + $events = &$all_events[$day->getStamp()]; + + $today12am = mktime(0, 0, 0, + $day->month, + $day->mday, + $day->year); + $tomorrow12am = mktime(0, 0, 0, + $day->month, + $day->mday + 1, + $day->year); + foreach ($events as $event) { + + if (!empty($this->_params['maxevents']) && + $totalevents >= $this->_params['maxevents']) { + break 2; + } + + if ($event->end->timestamp() < $now) { + continue; + } + if ($dayname != $olddayname) { + if (!$firstday) { + $html .= '

 
'; + $html .= $dayname . '
'; + } else { + $ctd = ''; + } + + if ($event->isAllDay()) { + $format = 'D, d M Y'; + } else { + $format = 'G:i T D, d M Y'; + } + + if ($event->start->timestamp() < $now) { + $time = _('until') . date($format, $event->end->timestamp()); + } else { + $time = date($format, $event->start->timestamp()) . _(' to ') . + date($format, $event->end->timestamp()); + } + + $html .= '
'; + + if ($event->start->timestamp() < $now && + $event->end->timestamp() > $now) { + $html .= ''; + } + + $html .= $time; + + if ($event->start->timestamp() < $now && + $event->end->timestamp() > $now) { + $html .= ''; + } + + $html .= '
'; + $html .= $event->getLocation(); + $html .= '
'; + $html .= $event->getTitle(); + $html .= '
'; + + $html .= '
'; + $desc = Text_Filter::filter($event->getDescription(), 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'class' => 'text')); + $html .= strtr($desc, array("\n" => " ", "\r" => " ")); + $html .= '
'; + + $html .= '
'; + + if (!empty($category)) { + $html .= '
'; + $html .= _("Category") . ': ' . $category; + $html .= '
'; + } + + $html .= '
'; + $html .= _("Calendar") . ': ' . urldecode($event->getCalendar()); + $html .= '
'; + + $html .= '
' . $html . '
'; + } + +} diff --git a/horde-webmail/kronolith/themes/embed.css b/horde-webmail/kronolith/themes/embed.css index 6ce8835..b084aa2 100644 --- a/horde-webmail/kronolith/themes/embed.css +++ b/horde-webmail/kronolith/themes/embed.css @@ -103,4 +103,53 @@ div.horde_nicetitle pre { text-align: left; font-size: 75%; font-family: "Lucida Console",Courier,"Courier New"; -} \ No newline at end of file +} + +.kronolith_embedded category_bar { +} + +.kronolith_embedded .eventtitle { + font-weight: bold; + padding: 5px; +} + +.kronolith_embedded .leftbar { + border-right: 1px solid #DDDDDD; + padding: 4px; +} + +.kronolith_embedded .location { + font-size: 85%; + padding-top: 10px; + margin-left: 5px; +} + +.kronolith_embedded .annotation { + font-size: 75%; + padding-top: 10px; + padding-left: 5px; +} + +.kronolith_embedded .description { + font-size: 85%; + padding-top: 10px; + padding-left: 5px; +} + +.kronolith_embedded .time { + font-size: 85%; + margin-top: 5px; + padding: 5px; + margin-left: 5px; + background: #ddddff; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.kronolith_embedded .section { + font-weight: bold; + background: #eeeeee; + border-bottom: 1px solid #999999; + color: #000000; + padding: 1px; +} diff --git a/horde-webmail/lib/Horde/Kolab/Storage/List.php b/horde-webmail/lib/Horde/Kolab/Storage/List.php index a9bff36..a31ef82 100644 --- a/horde-webmail/lib/Horde/Kolab/Storage/List.php +++ b/horde-webmail/lib/Horde/Kolab/Storage/List.php @@ -136,7 +136,7 @@ class Kolab_List { */ function &listFolders() { - if (!isset($this->_list)) { + if (!isset($this->_list) || is_a($this->_list, 'PEAR_Error')) { $session = &Horde_Kolab_Session::singleton(); $imap = &$session->getImap(); if (is_a($imap, 'PEAR_Error')) { -- tg: (2f74c4c..) t/kronolith/HK/GW/ExportEventList (depends on: t/dimp/H/BL/CloseContextMenu) -- TOPGIT patch commit log ======================= commit 992834cabdcc4a7aabbf566c7a5a27df639bef98 Author: Gunnar Wrobel

Date: Wed Oct 7 22:22:07 2009 +0200 Comment. commit 787cac7fd3a7dd282ad66596c30fc0eaf67bbe20 Author: Gunnar Wrobel

Date: Wed Oct 7 22:19:43 2009 +0200 Export a list of events. Index: series =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/series,v retrieving revision 1.5.2.3.2.3 retrieving revision 1.5.2.3.2.4 diff -u -d -r1.5.2.3.2.3 -r1.5.2.3.2.4 --- series 28 May 2009 14:26:36 -0000 1.5.2.3.2.3 +++ series 7 Oct 2009 21:01:46 -0000 1.5.2.3.2.4 @@ -71,3 +71,4 @@ t_pear_HK_GW_AddNetLDAP2.diff -p1 t_Kolab__Server_HK_GW_MappableAttributes.diff -p1 t_kronolith_HK_GW_AnonymousiCalDownload.diff -p1 +t_kronolith_HK_GW_ExportEventList.diff -p1 From cvs at kolab.org Wed Oct 7 23:01:49 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Wed, 7 Oct 2009 23:01:49 +0200 (CEST) Subject: gunnar: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.4.2.14, 1.32.2.4.2.15 Message-ID: <20091007210149.290CB600806@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv8377/patches/horde-webmail/1.2.0 Modified Files: Tag: suc_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Added functionality for anonymous java script based export of calendar data. Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.4.2.14 retrieving revision 1.32.2.4.2.15 diff -u -d -r1.32.2.4.2.14 -r1.32.2.4.2.15 --- horde-webmail-1.2.0_kolab_openpkg.patch 20 Jul 2009 08:39:06 -0000 1.32.2.4.2.14 +++ horde-webmail-1.2.0_kolab_openpkg.patch 7 Oct 2009 21:01:46 -0000 1.32.2.4.2.15 @@ -27122,6 +27122,459 @@ Date: Thu May 28 12:42:44 2009 +0200 First version of the anonymous ics download patch. +From: Gunnar Wrobel

+Subject: [PATCH] t/kronolith/HK/GW/ExportEventList + +Export a list of events. + +STATUS: OPEN + +Signed-off-by: Gunnar Wrobel

+ +--- + horde-webmail/kronolith/imple_kolab.php | 92 +++++++++ + horde-webmail/kronolith/lib/Block/eventlist.php | 243 +++++++++++++++++++++++ + horde-webmail/kronolith/themes/embed.css | 51 +++++- + horde-webmail/lib/Horde/Kolab/Storage/List.php | 2 +- + 4 files changed, 386 insertions(+), 2 deletions(-) + +diff --git a/horde-webmail/kronolith/imple_kolab.php b/horde-webmail/kronolith/imple_kolab.php +new file mode 100644 +index 0000000..f18d2ad +--- /dev/null ++++ b/horde-webmail/kronolith/imple_kolab.php +@@ -0,0 +1,92 @@ ++ ++ */ ++if (!defined('HORDE_BASE')) { ++ define('HORDE_BASE', dirname(__FILE__) . '/..'); ++} ++ ++/* Load the Horde Framework core, and set up inclusion paths. */ ++require_once HORDE_BASE . '/lib/core.php'; ++ ++ at define('AUTH_HANDLER', true); ++/* Registry. */ ++$session_control = 'none'; ++$registry = &Registry::singleton(HORDE_SESSION_NONE); ++ ++$auth = &Auth::singleton($conf['auth']['driver']); ++ ++if (isset($conf['ics']['default_user']) ++ && isset($conf['ics']['default_pass'])) { ++ $user = $conf['ics']['default_user']; ++ $pass = $conf['ics']['default_pass']; ++ $auth->authenticate($user, ++ array('password' => ++ $pass)); ++} ++ ++ at define('KRONOLITH_BASE', dirname(__FILE__)); ++require_once KRONOLITH_BASE . '/lib/base.php'; ++require_once KRONOLITH_BASE . '/lib/Imple.php'; ++ ++ ++$path = Util::getFormData('imple'); ++if (!$path) { ++ exit; ++} ++if ($path[0] == '/') { ++ $path = substr($path, 1); ++} ++$path = explode('/', $path); ++$impleName = array_shift($path); ++ ++$imple = Imple::factory($impleName); ++if (!$imple) { ++ exit; ++} ++ ++$args = array(); ++foreach ($path as $pair) { ++ if (strpos($pair, '=') === false) { ++ $args[$pair] = true; ++ } else { ++ list($name, $val) = explode('=', $pair); ++ $args[$name] = $val; ++ } ++} ++ ++$result = $imple->handle($args); ++ ++if (!empty($_SERVER['Content-Type'])) { ++ $ct = $_SERVER['Content-Type']; ++} else { ++ $ct = is_string($result) ? 'plain' : 'json'; ++} ++ ++switch ($ct) { ++case 'json': ++ header('Content-Type: text/x-json'); ++ require_once KRONOLITH_BASE . '/lib/JSON.php'; ++ echo Kronolith_Serialize_JSON::encode(String::convertCharset($result, NLS::getCharset(), 'utf-8')); ++ break; ++ ++case 'plain': ++ header('Content-Type: text/plain'); ++ echo $result; ++ break; ++ ++case 'html': ++ header('Content-Type: text/html'); ++ echo $result; ++ break; ++ ++default: ++ echo $result; ++} +diff --git a/horde-webmail/kronolith/lib/Block/eventlist.php b/horde-webmail/kronolith/lib/Block/eventlist.php +new file mode 100644 +index 0000000..420a984 +--- /dev/null ++++ b/horde-webmail/kronolith/lib/Block/eventlist.php +@@ -0,0 +1,243 @@ ++ array('name' => _("Days"), ++ 'type' => 'int', ++ 'default' => 42), ++ 'maxevents' => array('name' => _("Maximum number of events to display (0 = no limit)"), ++ 'type' => 'int', ++ 'default' => 0)); ++ ++ return $params; ++ } ++ ++ /** ++ * The title to go in this block. ++ * ++ * @return string The title text. ++ */ ++ function _title() ++ { ++ global $registry; ++ return ''; ++ } ++ ++ /** ++ * The content to go in this block. ++ * ++ * @return string The content ++ */ ++ function _content() ++ { ++ global $kronolith_driver, $registry, $prefs; ++ require_once dirname(__FILE__) . '/../base.php'; ++ require_once KRONOLITH_BASE . '/lib/Day.php'; ++ require_once 'Horde/Prefs/CategoryManager.php'; ++ require_once 'Horde/Text/Filter.php'; ++ ++ if (!empty($this->_params['days'])) { ++ $span = $this->_params['days']; ++ } else { ++ $span = 42; ++ } ++ ++ $now = $_SERVER['REQUEST_TIME']; ++ $today = date('j'); ++ ++ $startDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j'))); ++ $endDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j') + $span)); ++ $endDate->correct(); ++ ++ if (isset($this->_params['calendar']) && ++ $this->_params['calendar'] != '__all') { ++ ++ $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']); ++ if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) { ++ return _("Permission Denied"); ++ } ++ ++ $all_events = Kronolith::listEvents($startDate, ++ $endDate, ++ array($this->_params['calendar'])); ++ } else { ++ $calendars = Kronolith::listCalendars(false, PERMS_SHOW); ++ $all_events = Kronolith::listEvents($startDate, ++ $endDate, ++ array_keys($calendars)); ++ } ++ if (is_a($all_events, 'PEAR_Error')) { ++ return '' . $all_events->getMessage() . ''; ++ } ++ ++ $iMax = $today + $span; ++ ++ $html = ''; ++ $firstday = true; ++ $olddayname = ''; ++ $totalevents = 0; ++ ++ $displayed = array(); ++ ++ for ($i = $today; $i < $iMax; ++$i) { ++ $day = new Kronolith_Day(date('n'), $i); ++ ++ if ($day->isToday()) { ++ $dayname = _("Today"); ++ } elseif ($day->isTomorrow()) { ++ $dayname = _("Tomorrow"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear()) { ++ $dayname = _("This week"); ++ } elseif ($day->month == $startDate->month) { ++ if ($day->weekOfYear() == $startDate->weekOfYear() + 1) { ++ $dayname = _("Next week"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 2) { ++ $dayname = _("Two weeks from now"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 3) { ++ $dayname = _("Three weeks from now"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 4) { ++ $dayname = _("Four weeks from now"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 5) { ++ $dayname = _("Five weeks from now"); ++ } ++ } elseif ($day->month - 1 == $startDate->month ++ || ($day->month == 1 && $startDate->month == 12)) { ++ $dayname = _("Next month"); ++ } elseif ($day->year == $startDate->year) { ++ $dayname = $day->format('F'); ++ } elseif ($day->year - 1 == $startDate->year) { ++ $dayname = _("Next year"); ++ } else { ++ $dayname = _("After the next year"); ++ } ++ ++ if (empty($all_events[$day->getStamp()])) { ++ continue; ++ } ++ ++ $events = &$all_events[$day->getStamp()]; ++ ++ $today12am = mktime(0, 0, 0, ++ $day->month, ++ $day->mday, ++ $day->year); ++ $tomorrow12am = mktime(0, 0, 0, ++ $day->month, ++ $day->mday + 1, ++ $day->year); ++ foreach ($events as $event) { ++ ++ if (!empty($this->_params['maxevents']) && ++ $totalevents >= $this->_params['maxevents']) { ++ break 2; ++ } ++ ++ if ($event->end->timestamp() < $now) { ++ continue; ++ } ++ if ($dayname != $olddayname) { ++ if (!$firstday) { ++ $html .= ' '; ++ } ++ $html .= ''; ++ $html .= $dayname . ''; ++ $olddayname = $dayname; ++ $firstday = false; ++ } ++ ++ if (in_array($event->getId(), $displayed)) { ++ continue; ++ } ++ ++ $category = $event->getCategory(); ++ if (!empty($category)) { ++ $ctd = ''; ++ } else { ++ $ctd = ''; ++ } ++ ++ if ($event->isAllDay()) { ++ $format = 'D, d M Y'; ++ } else { ++ $format = 'G:i T D, d M Y'; ++ } ++ ++ if ($event->start->timestamp() < $now) { ++ $time = _('until') . date($format, $event->end->timestamp()); ++ } else { ++ $time = date($format, $event->start->timestamp()) . _(' to ') . ++ date($format, $event->end->timestamp()); ++ } ++ ++ $html .= '' . $ctd . '

'; ++ ++ if ($event->start->timestamp() < $now && ++ $event->end->timestamp() > $now) { ++ $html .= ''; ++ } ++ ++ $html .= $time; ++ ++ if ($event->start->timestamp() < $now && ++ $event->end->timestamp() > $now) { ++ $html .= ''; ++ } ++ ++ $html .= '
'; ++ $html .= $event->getLocation(); ++ $html .= '
'; ++ $html .= $event->getTitle(); ++ $html .= '
'; ++ ++ $html .= '
'; ++ $desc = Text_Filter::filter($event->getDescription(), 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'class' => 'text')); ++ $html .= strtr($desc, array("\n" => " ", "\r" => " ")); ++ $html .= '
'; ++ ++ $html .= ''; ++ ++ $html .= '' . $ctd . ''; ++ ++ if (!empty($category)) { ++ $html .= '
'; ++ $html .= _("Category") . ': ' . $category; ++ $html .= '
'; ++ } ++ ++ $html .= '
'; ++ $html .= _("Calendar") . ': ' . urldecode($event->getCalendar()); ++ $html .= '
'; ++ ++ $html .= ''; ++ ++ $totalevents++; ++ ++ $displayed[] = $event->getId(); ++ } ++ } ++ ++ if (empty($html)) { ++ return '' . _("No events to display") . ''; ++ } ++ ++ return '' . $html . '
'; ++ } ++ ++} +diff --git a/horde-webmail/kronolith/themes/embed.css b/horde-webmail/kronolith/themes/embed.css +index 6ce8835..b084aa2 100644 +--- a/horde-webmail/kronolith/themes/embed.css ++++ b/horde-webmail/kronolith/themes/embed.css +@@ -103,4 +103,53 @@ div.horde_nicetitle pre { + text-align: left; + font-size: 75%; + font-family: "Lucida Console",Courier,"Courier New"; +-} +\ No newline at end of file ++} ++ ++.kronolith_embedded category_bar { ++} ++ ++.kronolith_embedded .eventtitle { ++ font-weight: bold; ++ padding: 5px; ++} ++ ++.kronolith_embedded .leftbar { ++ border-right: 1px solid #DDDDDD; ++ padding: 4px; ++} ++ ++.kronolith_embedded .location { ++ font-size: 85%; ++ padding-top: 10px; ++ margin-left: 5px; ++} ++ ++.kronolith_embedded .annotation { ++ font-size: 75%; ++ padding-top: 10px; ++ padding-left: 5px; ++} ++ ++.kronolith_embedded .description { ++ font-size: 85%; ++ padding-top: 10px; ++ padding-left: 5px; ++} ++ ++.kronolith_embedded .time { ++ font-size: 85%; ++ margin-top: 5px; ++ padding: 5px; ++ margin-left: 5px; ++ background: #ddddff; ++ -moz-border-radius: 5px; ++ -webkit-border-radius: 5px; ++} ++ ++.kronolith_embedded .section { ++ font-weight: bold; ++ background: #eeeeee; ++ border-bottom: 1px solid #999999; ++ color: #000000; ++ padding: 1px; ++} +diff --git a/horde-webmail/lib/Horde/Kolab/Storage/List.php b/horde-webmail/lib/Horde/Kolab/Storage/List.php +index a9bff36..a31ef82 100644 +--- a/horde-webmail/lib/Horde/Kolab/Storage/List.php ++++ b/horde-webmail/lib/Horde/Kolab/Storage/List.php +@@ -136,7 +136,7 @@ class Kolab_List { + */ + function &listFolders() + { +- if (!isset($this->_list)) { ++ if (!isset($this->_list) || is_a($this->_list, 'PEAR_Error')) { + $session = &Horde_Kolab_Session::singleton(); + $imap = &$session->getImap(); + if (is_a($imap, 'PEAR_Error')) { +-- +tg: (2f74c4c..) t/kronolith/HK/GW/ExportEventList (depends on: t/dimp/H/BL/CloseContextMenu) +-- +TOPGIT patch commit log +======================= + +commit 992834cabdcc4a7aabbf566c7a5a27df639bef98 +Author: Gunnar Wrobel

+Date: Wed Oct 7 22:22:07 2009 +0200 + + Comment. + +commit 787cac7fd3a7dd282ad66596c30fc0eaf67bbe20 +Author: Gunnar Wrobel

+Date: Wed Oct 7 22:19:43 2009 +0200 + + Export a list of events. 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 From cvs at kolab.org Fri Oct 9 09:37:28 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 09:37:28 +0200 (CEST) Subject: gunnar: server/kolab-webclient ChangeLog, 1.10.2.3.2.5, 1.10.2.3.2.6 kolab-webclient.spec, 1.23.2.6.2.17, 1.23.2.6.2.18 Message-ID: <20091009073728.8AC04600801@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv566/kolab-webclient Modified Files: Tag: suc_branch ChangeLog kolab-webclient.spec Log Message: Cleaner session handling for the export. Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.3.2.5 retrieving revision 1.10.2.3.2.6 diff -u -d -r1.10.2.3.2.5 -r1.10.2.3.2.6 --- ChangeLog 7 Oct 2009 21:01:46 -0000 1.10.2.3.2.5 +++ ChangeLog 9 Oct 2009 07:37:26 -0000 1.10.2.3.2.6 @@ -1,3 +1,7 @@ +2009-10-09 Gunnar Wrobel

+ + * kolab-webclient.spec: Cleaner session handling for the export. + 2009-10-07 Gunnar Wrobel

* kolab-webclient.spec: Added functionality for anonymous Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.6.2.17 retrieving revision 1.23.2.6.2.18 diff -u -d -r1.23.2.6.2.17 -r1.23.2.6.2.18 --- kolab-webclient.spec 7 Oct 2009 21:01:46 -0000 1.23.2.6.2.17 +++ kolab-webclient.spec 9 Oct 2009 07:37:26 -0000 1.23.2.6.2.18 @@ -3,7 +3,7 @@ %define V_package kolab-webclient %define V_year 2009 %define V_month 10 -%define V_day 07 +%define V_day 09 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 From cvs at kolab.org Fri Oct 9 09:37:29 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 09:37:29 +0200 (CEST) Subject: gunnar: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_GW_ExportEventList.diff, 1.1.2.1, 1.1.2.2 Message-ID: <20091009073729.6C623600803@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv566/patches/horde-webmail/1.2.0/tg Modified Files: Tag: suc_branch t_kronolith_HK_GW_ExportEventList.diff Log Message: Cleaner session handling for the export. Index: t_kronolith_HK_GW_ExportEventList.diff =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/t_kronolith_HK_GW_ExportEventList.diff,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- t_kronolith_HK_GW_ExportEventList.diff 7 Oct 2009 21:01:46 -0000 1.1.2.1 +++ t_kronolith_HK_GW_ExportEventList.diff 9 Oct 2009 07:37:27 -0000 1.1.2.2 @@ -8,18 +8,18 @@ Signed-off-by: Gunnar Wrobel

--- - horde-webmail/kronolith/imple_kolab.php | 92 +++++++++ + horde-webmail/kronolith/imple_kolab.php | 96 +++++++++ horde-webmail/kronolith/lib/Block/eventlist.php | 243 +++++++++++++++++++++++ horde-webmail/kronolith/themes/embed.css | 51 +++++- horde-webmail/lib/Horde/Kolab/Storage/List.php | 2 +- - 4 files changed, 386 insertions(+), 2 deletions(-) + 4 files changed, 390 insertions(+), 2 deletions(-) diff --git a/horde-webmail/kronolith/imple_kolab.php b/horde-webmail/kronolith/imple_kolab.php new file mode 100644 -index 0000000..f18d2ad +index 0000000..65db938 --- /dev/null +++ b/horde-webmail/kronolith/imple_kolab.php -@@ -0,0 +1,92 @@ +@@ -0,0 +1,96 @@ + + */ -+if (!defined('HORDE_BASE')) { -+ define('HORDE_BASE', dirname(__FILE__) . '/..'); -+} + -+/* Load the Horde Framework core, and set up inclusion paths. */ -+require_once HORDE_BASE . '/lib/core.php'; ++function impleLogout() ++{ ++ Auth::clearAuth(); ++ @session_destroy(); ++} + + at define('AUTH_HANDLER', true); -+/* Registry. */ -+$session_control = 'none'; -+$registry = &Registry::singleton(HORDE_SESSION_NONE); ++ at define('HORDE_BASE', dirname(__FILE__) . '/..'); ++require_once HORDE_BASE . '/lib/base.php'; + -+$auth = &Auth::singleton($conf['auth']['driver']); ++// We want to always generate UTF-8 iCalendar data. ++NLS::setCharset('UTF-8'); ++ ++$auth = &Auth::singleton('kolab'); + +if (isset($conf['ics']['default_user']) + && isset($conf['ics']['default_pass'])) { + $user = $conf['ics']['default_user']; + $pass = $conf['ics']['default_pass']; ++ $_SESSION = array(); + $auth->authenticate($user, + array('password' => + $pass)); ++ register_shutdown_function('impleLogout'); +} + + at define('KRONOLITH_BASE', dirname(__FILE__)); @@ -112,6 +116,7 @@ +default: + echo $result; +} +\ No newline at end of file diff --git a/horde-webmail/kronolith/lib/Block/eventlist.php b/horde-webmail/kronolith/lib/Block/eventlist.php new file mode 100644 index 0000000..420a984 @@ -439,6 +444,18 @@ -- TOPGIT patch commit log ======================= + +commit 8d3a749ccd7f8512708a16f196220e46d7a5cb16 +Author: Gunnar Wrobel

+Date: Fri Oct 9 09:18:48 2009 +0200 + + Clean logout. + +commit c471608f1adfa116123b913959498d5b7f8defc6 +Author: Gunnar Wrobel

+Date: Fri Oct 9 08:45:58 2009 +0200 + + Cleaner session handling. commit 992834cabdcc4a7aabbf566c7a5a27df639bef98 Author: Gunnar Wrobel

From cvs at kolab.org Fri Oct 9 09:37:29 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 09:37:29 +0200 (CEST) Subject: gunnar: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.4.2.15, 1.32.2.4.2.16 Message-ID: <20091009073729.775DE600804@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv566/patches/horde-webmail/1.2.0 Modified Files: Tag: suc_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Cleaner session handling for the export. Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.4.2.15 retrieving revision 1.32.2.4.2.16 diff -u -d -r1.32.2.4.2.15 -r1.32.2.4.2.16 --- horde-webmail-1.2.0_kolab_openpkg.patch 7 Oct 2009 21:01:46 -0000 1.32.2.4.2.15 +++ horde-webmail-1.2.0_kolab_openpkg.patch 9 Oct 2009 07:37:26 -0000 1.32.2.4.2.16 @@ -27132,18 +27132,18 @@ Signed-off-by: Gunnar Wrobel

--- - horde-webmail/kronolith/imple_kolab.php | 92 +++++++++ + horde-webmail/kronolith/imple_kolab.php | 96 +++++++++ horde-webmail/kronolith/lib/Block/eventlist.php | 243 +++++++++++++++++++++++ horde-webmail/kronolith/themes/embed.css | 51 +++++- horde-webmail/lib/Horde/Kolab/Storage/List.php | 2 +- - 4 files changed, 386 insertions(+), 2 deletions(-) + 4 files changed, 390 insertions(+), 2 deletions(-) diff --git a/horde-webmail/kronolith/imple_kolab.php b/horde-webmail/kronolith/imple_kolab.php new file mode 100644 -index 0000000..f18d2ad +index 0000000..65db938 --- /dev/null +++ b/horde-webmail/kronolith/imple_kolab.php -@@ -0,0 +1,92 @@ +@@ -0,0 +1,96 @@ + + */ -+if (!defined('HORDE_BASE')) { -+ define('HORDE_BASE', dirname(__FILE__) . '/..'); -+} + -+/* Load the Horde Framework core, and set up inclusion paths. */ -+require_once HORDE_BASE . '/lib/core.php'; ++function impleLogout() ++{ ++ Auth::clearAuth(); ++ @session_destroy(); ++} + + at define('AUTH_HANDLER', true); -+/* Registry. */ -+$session_control = 'none'; -+$registry = &Registry::singleton(HORDE_SESSION_NONE); ++ at define('HORDE_BASE', dirname(__FILE__) . '/..'); ++require_once HORDE_BASE . '/lib/base.php'; + -+$auth = &Auth::singleton($conf['auth']['driver']); ++// We want to always generate UTF-8 iCalendar data. ++NLS::setCharset('UTF-8'); ++ ++$auth = &Auth::singleton('kolab'); + +if (isset($conf['ics']['default_user']) + && isset($conf['ics']['default_pass'])) { + $user = $conf['ics']['default_user']; + $pass = $conf['ics']['default_pass']; ++ $_SESSION = array(); + $auth->authenticate($user, + array('password' => + $pass)); ++ register_shutdown_function('impleLogout'); +} + + at define('KRONOLITH_BASE', dirname(__FILE__)); @@ -27236,6 +27240,7 @@ +default: + echo $result; +} +\ No newline at end of file diff --git a/horde-webmail/kronolith/lib/Block/eventlist.php b/horde-webmail/kronolith/lib/Block/eventlist.php new file mode 100644 index 0000000..420a984 @@ -27563,6 +27568,18 @@ -- TOPGIT patch commit log ======================= + +commit 8d3a749ccd7f8512708a16f196220e46d7a5cb16 +Author: Gunnar Wrobel

+Date: Fri Oct 9 09:18:48 2009 +0200 + + Clean logout. + +commit c471608f1adfa116123b913959498d5b7f8defc6 +Author: Gunnar Wrobel

+Date: Fri Oct 9 08:45:58 2009 +0200 + + Cleaner session handling. commit 992834cabdcc4a7aabbf566c7a5a27df639bef98 Author: Gunnar Wrobel

From cvs at kolab.org Fri Oct 9 18:11:53 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 18:11:53 +0200 (CEST) Subject: wilde: server/kolab-webclient ChangeLog, 1.10.2.6, 1.10.2.7 kolab-webclient.spec, 1.23.2.10, 1.23.2.11 webclient-kolab-conf.template, 1.2, 1.2.2.1 Message-ID: <20091009161153.32D7A600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv25112/kolab-webclient Modified Files: Tag: kolab_2_2_branch ChangeLog kolab-webclient.spec webclient-kolab-conf.template Log Message: Added new anonymous web calendar. (Merged from suc_branch) Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.6 retrieving revision 1.10.2.7 diff -u -d -r1.10.2.6 -r1.10.2.7 --- ChangeLog 10 Sep 2009 09:32:26 -0000 1.10.2.6 +++ ChangeLog 9 Oct 2009 16:11:50 -0000 1.10.2.7 @@ -1,3 +1,12 @@ +2009-10-09 Gunnar Wrobel

+ + * kolab-webclient.spec: Cleaner session handling for the export. + +2009-10-07 Gunnar Wrobel

+ + * kolab-webclient.spec: Added functionality for anonymous + java script based export of calendar data. + 2009-09-10 Gunnar Wrobel

* kolab-webclient.spec: Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.10 retrieving revision 1.23.2.11 diff -u -d -r1.23.2.10 -r1.23.2.11 --- kolab-webclient.spec 10 Sep 2009 09:32:26 -0000 1.23.2.10 +++ kolab-webclient.spec 9 Oct 2009 16:11:50 -0000 1.23.2.11 @@ -2,8 +2,8 @@ %define V_horde_name horde-webmail %define V_package kolab-webclient %define V_year 2009 -%define V_month 09 -%define V_day 10 +%define V_month 10 +%define V_day 09 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 Index: webclient-kolab-conf.template =================================================================== RCS file: /kolabrepository/server/kolab-webclient/webclient-kolab-conf.template,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- webclient-kolab-conf.template 7 Feb 2009 15:51:27 -0000 1.2 +++ webclient-kolab-conf.template 9 Oct 2009 16:11:51 -0000 1.2.2.1 @@ -18,4 +18,14 @@ $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 /public-cal/ics. You will need to create this user first. + */ +//$conf['ics']['default_user'] = 'proxy@@@@postfix-mydomain@@@'; +//$conf['ics']['default_pass'] = 'proxy'; +/** + * Uncomment if you wish to hide the organizer which is currently the proxy user. + */ +//$conf['ics']['hide_organizer'] = true; ?> From cvs at kolab.org Fri Oct 9 18:11:53 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 18:11:53 +0200 (CEST) Subject: wilde: server release-notes.txt,1.398.2.55,1.398.2.56 Message-ID: <20091009161153.32DFE600803@lists.intevation.de> Author: wilde Update of /kolabrepository/server In directory doto:/tmp/cvs-serv25112 Modified Files: Tag: kolab_2_2_branch release-notes.txt Log Message: Added new anonymous web calendar. (Merged from suc_branch) Index: release-notes.txt =================================================================== RCS file: /kolabrepository/server/release-notes.txt,v retrieving revision 1.398.2.55 retrieving revision 1.398.2.56 diff -u -d -r1.398.2.55 -r1.398.2.56 --- release-notes.txt 23 Sep 2009 16:29:48 -0000 1.398.2.55 +++ release-notes.txt 9 Oct 2009 16:11:50 -0000 1.398.2.56 @@ -60,6 +60,14 @@ - kolab-webclient-1.2.0-20090514 + A proxy user can now be defined in the + webclient-kolab-conf.template which allows anonymous read only + access to all the users calendars. + + The proxy users calender-events can be integrated into third + party sites using the new client/kronolith/imple_kolab.php + feature. + kolab/issue3509 (calender not displaying in horde if german holidays are selected) kolab/issue3555 (unable to save filter settings more than once) From cvs at kolab.org Fri Oct 9 18:11:53 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 18:11:53 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_GW_ExportEventList.diff, NONE, 1.1.4.1 series, 1.5.2.4, 1.5.2.5 Message-ID: <20091009161153.69DC4600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv25112/patches/horde-webmail/1.2.0/tg Modified Files: Tag: kolab_2_2_branch series Added Files: Tag: kolab_2_2_branch t_kronolith_HK_GW_ExportEventList.diff Log Message: Added new anonymous web calendar. (Merged from suc_branch) --- NEW FILE: t_kronolith_HK_GW_ExportEventList.diff --- From: Gunnar Wrobel

Subject: [PATCH] t/kronolith/HK/GW/ExportEventList Export a list of events. STATUS: OPEN Signed-off-by: Gunnar Wrobel

--- horde-webmail/kronolith/imple_kolab.php | 96 +++++++++ horde-webmail/kronolith/lib/Block/eventlist.php | 243 +++++++++++++++++++++++ horde-webmail/kronolith/themes/embed.css | 51 +++++- horde-webmail/lib/Horde/Kolab/Storage/List.php | 2 +- 4 files changed, 390 insertions(+), 2 deletions(-) diff --git a/horde-webmail/kronolith/imple_kolab.php b/horde-webmail/kronolith/imple_kolab.php new file mode 100644 index 0000000..65db938 --- /dev/null +++ b/horde-webmail/kronolith/imple_kolab.php @@ -0,0 +1,96 @@ + + */ + +function impleLogout() +{ + Auth::clearAuth(); + @session_destroy(); +} + + at define('AUTH_HANDLER', true); + at 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'); + +$auth = &Auth::singleton('kolab'); + +if (isset($conf['ics']['default_user']) + && isset($conf['ics']['default_pass'])) { + $user = $conf['ics']['default_user']; + $pass = $conf['ics']['default_pass']; + $_SESSION = array(); + $auth->authenticate($user, + array('password' => + $pass)); + register_shutdown_function('impleLogout'); +} + + at define('KRONOLITH_BASE', dirname(__FILE__)); +require_once KRONOLITH_BASE . '/lib/base.php'; +require_once KRONOLITH_BASE . '/lib/Imple.php'; + + +$path = Util::getFormData('imple'); +if (!$path) { + exit; +} +if ($path[0] == '/') { + $path = substr($path, 1); +} +$path = explode('/', $path); +$impleName = array_shift($path); + +$imple = Imple::factory($impleName); +if (!$imple) { + exit; +} + +$args = array(); +foreach ($path as $pair) { + if (strpos($pair, '=') === false) { + $args[$pair] = true; + } else { + list($name, $val) = explode('=', $pair); + $args[$name] = $val; + } +} + +$result = $imple->handle($args); + +if (!empty($_SERVER['Content-Type'])) { + $ct = $_SERVER['Content-Type']; +} else { + $ct = is_string($result) ? 'plain' : 'json'; +} + +switch ($ct) { +case 'json': + header('Content-Type: text/x-json'); + require_once KRONOLITH_BASE . '/lib/JSON.php'; + echo Kronolith_Serialize_JSON::encode(String::convertCharset($result, NLS::getCharset(), 'utf-8')); + break; + +case 'plain': + header('Content-Type: text/plain'); + echo $result; + break; + +case 'html': + header('Content-Type: text/html'); + echo $result; + break; + +default: + echo $result; +} \ No newline at end of file diff --git a/horde-webmail/kronolith/lib/Block/eventlist.php b/horde-webmail/kronolith/lib/Block/eventlist.php new file mode 100644 index 0000000..420a984 --- /dev/null +++ b/horde-webmail/kronolith/lib/Block/eventlist.php @@ -0,0 +1,243 @@ + array('name' => _("Days"), + 'type' => 'int', + 'default' => 42), + 'maxevents' => array('name' => _("Maximum number of events to display (0 = no limit)"), + 'type' => 'int', + 'default' => 0)); + + return $params; + } + + /** + * The title to go in this block. + * + * @return string The title text. + */ + function _title() + { + global $registry; + return ''; + } + + /** + * The content to go in this block. + * + * @return string The content + */ + function _content() + { + global $kronolith_driver, $registry, $prefs; + require_once dirname(__FILE__) . '/../base.php'; + require_once KRONOLITH_BASE . '/lib/Day.php'; + require_once 'Horde/Prefs/CategoryManager.php'; + require_once 'Horde/Text/Filter.php'; + + if (!empty($this->_params['days'])) { + $span = $this->_params['days']; + } else { + $span = 42; + } + + $now = $_SERVER['REQUEST_TIME']; + $today = date('j'); + + $startDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j'))); + $endDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j') + $span)); + $endDate->correct(); + + if (isset($this->_params['calendar']) && + $this->_params['calendar'] != '__all') { + + $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']); + if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) { + return _("Permission Denied"); + } + + $all_events = Kronolith::listEvents($startDate, + $endDate, + array($this->_params['calendar'])); + } else { + $calendars = Kronolith::listCalendars(false, PERMS_SHOW); + $all_events = Kronolith::listEvents($startDate, + $endDate, + array_keys($calendars)); + } + if (is_a($all_events, 'PEAR_Error')) { + return '' . $all_events->getMessage() . ''; + } + + $iMax = $today + $span; + + $html = ''; + $firstday = true; + $olddayname = ''; + $totalevents = 0; + + $displayed = array(); + + for ($i = $today; $i < $iMax; ++$i) { + $day = new Kronolith_Day(date('n'), $i); + + if ($day->isToday()) { + $dayname = _("Today"); + } elseif ($day->isTomorrow()) { + $dayname = _("Tomorrow"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear()) { + $dayname = _("This week"); + } elseif ($day->month == $startDate->month) { + if ($day->weekOfYear() == $startDate->weekOfYear() + 1) { + $dayname = _("Next week"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 2) { + $dayname = _("Two weeks from now"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 3) { + $dayname = _("Three weeks from now"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 4) { + $dayname = _("Four weeks from now"); + } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 5) { + $dayname = _("Five weeks from now"); + } + } elseif ($day->month - 1 == $startDate->month + || ($day->month == 1 && $startDate->month == 12)) { + $dayname = _("Next month"); + } elseif ($day->year == $startDate->year) { + $dayname = $day->format('F'); + } elseif ($day->year - 1 == $startDate->year) { + $dayname = _("Next year"); + } else { + $dayname = _("After the next year"); + } + + if (empty($all_events[$day->getStamp()])) { + continue; + } + + $events = &$all_events[$day->getStamp()]; + + $today12am = mktime(0, 0, 0, + $day->month, + $day->mday, + $day->year); + $tomorrow12am = mktime(0, 0, 0, + $day->month, + $day->mday + 1, + $day->year); + foreach ($events as $event) { + + if (!empty($this->_params['maxevents']) && + $totalevents >= $this->_params['maxevents']) { + break 2; + } + + if ($event->end->timestamp() < $now) { + continue; + } + if ($dayname != $olddayname) { + if (!$firstday) { + $html .= ' '; + } + $html .= ''; + $html .= $dayname . ''; + $olddayname = $dayname; + $firstday = false; + } + + if (in_array($event->getId(), $displayed)) { + continue; + } + + $category = $event->getCategory(); + if (!empty($category)) { + $ctd = ''; + } else { + $ctd = ''; + } + + if ($event->isAllDay()) { + $format = 'D, d M Y'; + } else { + $format = 'G:i T D, d M Y'; + } + + if ($event->start->timestamp() < $now) { + $time = _('until') . date($format, $event->end->timestamp()); + } else { + $time = date($format, $event->start->timestamp()) . _(' to ') . + date($format, $event->end->timestamp()); + } + + $html .= '' . $ctd . '

'; + + if ($event->start->timestamp() < $now && + $event->end->timestamp() > $now) { + $html .= ''; + } + + $html .= $time; + + if ($event->start->timestamp() < $now && + $event->end->timestamp() > $now) { + $html .= ''; + } + + $html .= '
'; + $html .= $event->getLocation(); + $html .= '
'; + $html .= $event->getTitle(); + $html .= '
'; + + $html .= '
'; + $desc = Text_Filter::filter($event->getDescription(), 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'class' => 'text')); + $html .= strtr($desc, array("\n" => " ", "\r" => " ")); + $html .= '
'; + + $html .= ''; + + $html .= '' . $ctd . ''; + + if (!empty($category)) { + $html .= '
'; + $html .= _("Category") . ': ' . $category; + $html .= '
'; + } + + $html .= '
'; + $html .= _("Calendar") . ': ' . urldecode($event->getCalendar()); + $html .= '
'; + + $html .= ''; + + $totalevents++; + + $displayed[] = $event->getId(); + } + } + + if (empty($html)) { + return '' . _("No events to display") . ''; + } + + return '' . $html . '
'; + } + +} diff --git a/horde-webmail/kronolith/themes/embed.css b/horde-webmail/kronolith/themes/embed.css index 6ce8835..b084aa2 100644 --- a/horde-webmail/kronolith/themes/embed.css +++ b/horde-webmail/kronolith/themes/embed.css @@ -103,4 +103,53 @@ div.horde_nicetitle pre { text-align: left; font-size: 75%; font-family: "Lucida Console",Courier,"Courier New"; -} \ No newline at end of file +} + +.kronolith_embedded category_bar { +} + +.kronolith_embedded .eventtitle { + font-weight: bold; + padding: 5px; +} + +.kronolith_embedded .leftbar { + border-right: 1px solid #DDDDDD; + padding: 4px; +} + +.kronolith_embedded .location { + font-size: 85%; + padding-top: 10px; + margin-left: 5px; +} + +.kronolith_embedded .annotation { + font-size: 75%; + padding-top: 10px; + padding-left: 5px; +} + +.kronolith_embedded .description { + font-size: 85%; + padding-top: 10px; + padding-left: 5px; +} + +.kronolith_embedded .time { + font-size: 85%; + margin-top: 5px; + padding: 5px; + margin-left: 5px; + background: #ddddff; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.kronolith_embedded .section { + font-weight: bold; + background: #eeeeee; + border-bottom: 1px solid #999999; + color: #000000; + padding: 1px; +} diff --git a/horde-webmail/lib/Horde/Kolab/Storage/List.php b/horde-webmail/lib/Horde/Kolab/Storage/List.php index a9bff36..a31ef82 100644 --- a/horde-webmail/lib/Horde/Kolab/Storage/List.php +++ b/horde-webmail/lib/Horde/Kolab/Storage/List.php @@ -136,7 +136,7 @@ class Kolab_List { */ function &listFolders() { - if (!isset($this->_list)) { + if (!isset($this->_list) || is_a($this->_list, 'PEAR_Error')) { $session = &Horde_Kolab_Session::singleton(); $imap = &$session->getImap(); if (is_a($imap, 'PEAR_Error')) { -- tg: (2f74c4c..) t/kronolith/HK/GW/ExportEventList (depends on: t/dimp/H/BL/CloseContextMenu) -- TOPGIT patch commit log ======================= commit 8d3a749ccd7f8512708a16f196220e46d7a5cb16 Author: Gunnar Wrobel

Date: Fri Oct 9 09:18:48 2009 +0200 Clean logout. commit c471608f1adfa116123b913959498d5b7f8defc6 Author: Gunnar Wrobel

Date: Fri Oct 9 08:45:58 2009 +0200 Cleaner session handling. commit 992834cabdcc4a7aabbf566c7a5a27df639bef98 Author: Gunnar Wrobel

Date: Wed Oct 7 22:22:07 2009 +0200 Comment. commit 787cac7fd3a7dd282ad66596c30fc0eaf67bbe20 Author: Gunnar Wrobel

Date: Wed Oct 7 22:19:43 2009 +0200 Export a list of events. Index: series =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/series,v retrieving revision 1.5.2.4 retrieving revision 1.5.2.5 diff -u -d -r1.5.2.4 -r1.5.2.5 --- series 10 Sep 2009 09:32:26 -0000 1.5.2.4 +++ series 9 Oct 2009 16:11:51 -0000 1.5.2.5 @@ -69,3 +69,4 @@ t_imp_H_MS_bug7438.diff -p1 t_Kolab__Format_HK_GW_HandleEmptyXmlParserReturn.diff -p1 t_framework_HK_GW_Prefs_FileDriverHotfix.diff -p1 +t_kronolith_HK_GW_ExportEventList.diff -p1 From cvs at kolab.org Fri Oct 9 18:11:53 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 18:11:53 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.10, 1.32.2.11 Message-ID: <20091009161153.A49B4600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv25112/patches/horde-webmail/1.2.0 Modified Files: Tag: kolab_2_2_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Added new anonymous web calendar. (Merged from suc_branch) Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.10 retrieving revision 1.32.2.11 diff -u -d -r1.32.2.10 -r1.32.2.11 --- horde-webmail-1.2.0_kolab_openpkg.patch 23 Sep 2009 08:59:42 -0000 1.32.2.10 +++ horde-webmail-1.2.0_kolab_openpkg.patch 9 Oct 2009 16:11:51 -0000 1.32.2.11 @@ -20021,6 +20021,476 @@ } } +From: Gunnar Wrobel

+Subject: [PATCH] t/kronolith/HK/GW/ExportEventList + +Export a list of events. + +STATUS: OPEN + +Signed-off-by: Gunnar Wrobel

+ +--- + horde-webmail/kronolith/imple_kolab.php | 96 +++++++++ + horde-webmail/kronolith/lib/Block/eventlist.php | 243 +++++++++++++++++++++++ + horde-webmail/kronolith/themes/embed.css | 51 +++++- + horde-webmail/lib/Horde/Kolab/Storage/List.php | 2 +- + 4 files changed, 390 insertions(+), 2 deletions(-) + +diff --git a/horde-webmail/kronolith/imple_kolab.php b/horde-webmail/kronolith/imple_kolab.php +new file mode 100644 +index 0000000..65db938 +--- /dev/null ++++ b/horde-webmail/kronolith/imple_kolab.php +@@ -0,0 +1,96 @@ ++ ++ */ ++ ++function impleLogout() ++{ ++ Auth::clearAuth(); ++ @session_destroy(); ++} ++ ++ at define('AUTH_HANDLER', true); ++ at 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'); ++ ++$auth = &Auth::singleton('kolab'); ++ ++if (isset($conf['ics']['default_user']) ++ && isset($conf['ics']['default_pass'])) { ++ $user = $conf['ics']['default_user']; ++ $pass = $conf['ics']['default_pass']; ++ $_SESSION = array(); ++ $auth->authenticate($user, ++ array('password' => ++ $pass)); ++ register_shutdown_function('impleLogout'); ++} ++ ++ at define('KRONOLITH_BASE', dirname(__FILE__)); ++require_once KRONOLITH_BASE . '/lib/base.php'; ++require_once KRONOLITH_BASE . '/lib/Imple.php'; ++ ++ ++$path = Util::getFormData('imple'); ++if (!$path) { ++ exit; ++} ++if ($path[0] == '/') { ++ $path = substr($path, 1); ++} ++$path = explode('/', $path); ++$impleName = array_shift($path); ++ ++$imple = Imple::factory($impleName); ++if (!$imple) { ++ exit; ++} ++ ++$args = array(); ++foreach ($path as $pair) { ++ if (strpos($pair, '=') === false) { ++ $args[$pair] = true; ++ } else { ++ list($name, $val) = explode('=', $pair); ++ $args[$name] = $val; ++ } ++} ++ ++$result = $imple->handle($args); ++ ++if (!empty($_SERVER['Content-Type'])) { ++ $ct = $_SERVER['Content-Type']; ++} else { ++ $ct = is_string($result) ? 'plain' : 'json'; ++} ++ ++switch ($ct) { ++case 'json': ++ header('Content-Type: text/x-json'); ++ require_once KRONOLITH_BASE . '/lib/JSON.php'; ++ echo Kronolith_Serialize_JSON::encode(String::convertCharset($result, NLS::getCharset(), 'utf-8')); ++ break; ++ ++case 'plain': ++ header('Content-Type: text/plain'); ++ echo $result; ++ break; ++ ++case 'html': ++ header('Content-Type: text/html'); ++ echo $result; ++ break; ++ ++default: ++ echo $result; ++} +\ No newline at end of file +diff --git a/horde-webmail/kronolith/lib/Block/eventlist.php b/horde-webmail/kronolith/lib/Block/eventlist.php +new file mode 100644 +index 0000000..420a984 +--- /dev/null ++++ b/horde-webmail/kronolith/lib/Block/eventlist.php +@@ -0,0 +1,243 @@ ++ array('name' => _("Days"), ++ 'type' => 'int', ++ 'default' => 42), ++ 'maxevents' => array('name' => _("Maximum number of events to display (0 = no limit)"), ++ 'type' => 'int', ++ 'default' => 0)); ++ ++ return $params; ++ } ++ ++ /** ++ * The title to go in this block. ++ * ++ * @return string The title text. ++ */ ++ function _title() ++ { ++ global $registry; ++ return ''; ++ } ++ ++ /** ++ * The content to go in this block. ++ * ++ * @return string The content ++ */ ++ function _content() ++ { ++ global $kronolith_driver, $registry, $prefs; ++ require_once dirname(__FILE__) . '/../base.php'; ++ require_once KRONOLITH_BASE . '/lib/Day.php'; ++ require_once 'Horde/Prefs/CategoryManager.php'; ++ require_once 'Horde/Text/Filter.php'; ++ ++ if (!empty($this->_params['days'])) { ++ $span = $this->_params['days']; ++ } else { ++ $span = 42; ++ } ++ ++ $now = $_SERVER['REQUEST_TIME']; ++ $today = date('j'); ++ ++ $startDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j'))); ++ $endDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n'), 'mday' => date('j') + $span)); ++ $endDate->correct(); ++ ++ if (isset($this->_params['calendar']) && ++ $this->_params['calendar'] != '__all') { ++ ++ $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']); ++ if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) { ++ return _("Permission Denied"); ++ } ++ ++ $all_events = Kronolith::listEvents($startDate, ++ $endDate, ++ array($this->_params['calendar'])); ++ } else { ++ $calendars = Kronolith::listCalendars(false, PERMS_SHOW); ++ $all_events = Kronolith::listEvents($startDate, ++ $endDate, ++ array_keys($calendars)); ++ } ++ if (is_a($all_events, 'PEAR_Error')) { ++ return '' . $all_events->getMessage() . ''; ++ } ++ ++ $iMax = $today + $span; ++ ++ $html = ''; ++ $firstday = true; ++ $olddayname = ''; ++ $totalevents = 0; ++ ++ $displayed = array(); ++ ++ for ($i = $today; $i < $iMax; ++$i) { ++ $day = new Kronolith_Day(date('n'), $i); ++ ++ if ($day->isToday()) { ++ $dayname = _("Today"); ++ } elseif ($day->isTomorrow()) { ++ $dayname = _("Tomorrow"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear()) { ++ $dayname = _("This week"); ++ } elseif ($day->month == $startDate->month) { ++ if ($day->weekOfYear() == $startDate->weekOfYear() + 1) { ++ $dayname = _("Next week"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 2) { ++ $dayname = _("Two weeks from now"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 3) { ++ $dayname = _("Three weeks from now"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 4) { ++ $dayname = _("Four weeks from now"); ++ } elseif ($day->weekOfYear() == $startDate->weekOfYear() + 5) { ++ $dayname = _("Five weeks from now"); ++ } ++ } elseif ($day->month - 1 == $startDate->month ++ || ($day->month == 1 && $startDate->month == 12)) { ++ $dayname = _("Next month"); ++ } elseif ($day->year == $startDate->year) { ++ $dayname = $day->format('F'); ++ } elseif ($day->year - 1 == $startDate->year) { ++ $dayname = _("Next year"); ++ } else { ++ $dayname = _("After the next year"); ++ } ++ ++ if (empty($all_events[$day->getStamp()])) { ++ continue; ++ } ++ ++ $events = &$all_events[$day->getStamp()]; ++ ++ $today12am = mktime(0, 0, 0, ++ $day->month, ++ $day->mday, ++ $day->year); ++ $tomorrow12am = mktime(0, 0, 0, ++ $day->month, ++ $day->mday + 1, ++ $day->year); ++ foreach ($events as $event) { ++ ++ if (!empty($this->_params['maxevents']) && ++ $totalevents >= $this->_params['maxevents']) { ++ break 2; ++ } ++ ++ if ($event->end->timestamp() < $now) { ++ continue; ++ } ++ if ($dayname != $olddayname) { ++ if (!$firstday) { ++ $html .= ' '; ++ } ++ $html .= ''; ++ $html .= $dayname . ''; ++ $olddayname = $dayname; ++ $firstday = false; ++ } ++ ++ if (in_array($event->getId(), $displayed)) { ++ continue; ++ } ++ ++ $category = $event->getCategory(); ++ if (!empty($category)) { ++ $ctd = ''; ++ } else { ++ $ctd = ''; ++ } ++ ++ if ($event->isAllDay()) { ++ $format = 'D, d M Y'; ++ } else { ++ $format = 'G:i T D, d M Y'; ++ } ++ ++ if ($event->start->timestamp() < $now) { ++ $time = _('until') . date($format, $event->end->timestamp()); ++ } else { ++ $time = date($format, $event->start->timestamp()) . _(' to ') . ++ date($format, $event->end->timestamp()); ++ } ++ ++ $html .= '' . $ctd . '

'; ++ ++ if ($event->start->timestamp() < $now && ++ $event->end->timestamp() > $now) { ++ $html .= ''; ++ } ++ ++ $html .= $time; ++ ++ if ($event->start->timestamp() < $now && ++ $event->end->timestamp() > $now) { ++ $html .= ''; ++ } ++ ++ $html .= '
'; ++ $html .= $event->getLocation(); ++ $html .= '
'; ++ $html .= $event->getTitle(); ++ $html .= '
'; ++ ++ $html .= '
'; ++ $desc = Text_Filter::filter($event->getDescription(), 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'class' => 'text')); ++ $html .= strtr($desc, array("\n" => " ", "\r" => " ")); ++ $html .= '
'; ++ ++ $html .= ''; ++ ++ $html .= '' . $ctd . ''; ++ ++ if (!empty($category)) { ++ $html .= '
'; ++ $html .= _("Category") . ': ' . $category; ++ $html .= '
'; ++ } ++ ++ $html .= '
'; ++ $html .= _("Calendar") . ': ' . urldecode($event->getCalendar()); ++ $html .= '
'; ++ ++ $html .= ''; ++ ++ $totalevents++; ++ ++ $displayed[] = $event->getId(); ++ } ++ } ++ ++ if (empty($html)) { ++ return '' . _("No events to display") . ''; ++ } ++ ++ return '' . $html . '
'; ++ } ++ ++} +diff --git a/horde-webmail/kronolith/themes/embed.css b/horde-webmail/kronolith/themes/embed.css +index 6ce8835..b084aa2 100644 +--- a/horde-webmail/kronolith/themes/embed.css ++++ b/horde-webmail/kronolith/themes/embed.css +@@ -103,4 +103,53 @@ div.horde_nicetitle pre { + text-align: left; + font-size: 75%; + font-family: "Lucida Console",Courier,"Courier New"; +-} +\ No newline at end of file ++} ++ ++.kronolith_embedded category_bar { ++} ++ ++.kronolith_embedded .eventtitle { ++ font-weight: bold; ++ padding: 5px; ++} ++ ++.kronolith_embedded .leftbar { ++ border-right: 1px solid #DDDDDD; ++ padding: 4px; ++} ++ ++.kronolith_embedded .location { ++ font-size: 85%; ++ padding-top: 10px; ++ margin-left: 5px; ++} ++ ++.kronolith_embedded .annotation { ++ font-size: 75%; ++ padding-top: 10px; ++ padding-left: 5px; ++} ++ ++.kronolith_embedded .description { ++ font-size: 85%; ++ padding-top: 10px; ++ padding-left: 5px; ++} ++ ++.kronolith_embedded .time { ++ font-size: 85%; ++ margin-top: 5px; ++ padding: 5px; ++ margin-left: 5px; ++ background: #ddddff; ++ -moz-border-radius: 5px; ++ -webkit-border-radius: 5px; ++} ++ ++.kronolith_embedded .section { ++ font-weight: bold; ++ background: #eeeeee; ++ border-bottom: 1px solid #999999; ++ color: #000000; ++ padding: 1px; ++} +diff --git a/horde-webmail/lib/Horde/Kolab/Storage/List.php b/horde-webmail/lib/Horde/Kolab/Storage/List.php +index a9bff36..a31ef82 100644 +--- a/horde-webmail/lib/Horde/Kolab/Storage/List.php ++++ b/horde-webmail/lib/Horde/Kolab/Storage/List.php +@@ -136,7 +136,7 @@ class Kolab_List { + */ + function &listFolders() + { +- if (!isset($this->_list)) { ++ if (!isset($this->_list) || is_a($this->_list, 'PEAR_Error')) { + $session = &Horde_Kolab_Session::singleton(); + $imap = &$session->getImap(); + if (is_a($imap, 'PEAR_Error')) { +-- +tg: (2f74c4c..) t/kronolith/HK/GW/ExportEventList (depends on: t/dimp/H/BL/CloseContextMenu) +-- +TOPGIT patch commit log +======================= + +commit 8d3a749ccd7f8512708a16f196220e46d7a5cb16 +Author: Gunnar Wrobel

+Date: Fri Oct 9 09:18:48 2009 +0200 + + Clean logout. + +commit c471608f1adfa116123b913959498d5b7f8defc6 +Author: Gunnar Wrobel

+Date: Fri Oct 9 08:45:58 2009 +0200 + + Cleaner session handling. + +commit 992834cabdcc4a7aabbf566c7a5a27df639bef98 +Author: Gunnar Wrobel

+Date: Wed Oct 7 22:22:07 2009 +0200 + + Comment. + +commit 787cac7fd3a7dd282ad66596c30fc0eaf67bbe20 +Author: Gunnar Wrobel

+Date: Wed Oct 7 22:19:43 2009 +0200 + + Export a list of events. 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 From cvs at kolab.org Fri Oct 9 18:12:37 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 9 Oct 2009 18:12:37 +0200 (CEST) Subject: wilde: doc/raw-howtos web-calendar.txt,NONE,1.1 Message-ID: <20091009161237.6694E600801@lists.intevation.de> Author: wilde Update of /kolabrepository/doc/raw-howtos In directory doto:/tmp/cvs-serv25228 Added Files: web-calendar.txt Log Message: Added mini doc for new anonymous web calendar. --- NEW FILE: web-calendar.txt --- ------------------------------------------------------------------------ The anonymous Kolab Web Calendar ------------------------------------------------------------------------ Sascha Wilde Since 2009/10/09 the CVS kolab_2_2_branch contains a new feature, allowing to integrate a view of dedicated calendars into third party web sites. Concept: A dedicated "proxy" user is created and the id and password of this user is made known to certain parts of the webclient. The proxy user is granted read access to one or more calendar by regular Kolab users. A view of the events in these shared calendars is offered for anonymous (read: no authorization required) integration in websites. Usage: 1. Create an new user account e.g. "proxy at example.com" with password "secret". 2. In /kolab/etc/kolab/templates/webclient-kolab-conf.template the lines $conf['ics']['default_user'] = 'proxy@@@@postfix-mydomain@@@'; $conf['ics']['default_pass'] = 'proxy'; must be uncommented and filled with the correct credentials a chosen in 1. 3. Grant list/read access for some calendar folders to the user "proxy at example.com". 4. Add to any web-page following lines:

The
tag will be replaced by an view of all upcoming events in the calendars accessible for the proxy user. Security considerations: One should note, that the data from calendars shared to the proxy user is freely, world wide readable unless the access to the Kolab Webclient server is restricted by other means. From cvs at kolab.org Mon Oct 12 14:46:49 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 14:46:49 +0200 (CEST) Subject: wilde: server/kolab-webclient ChangeLog,1.10.2.7,1.10.2.8 Message-ID: <20091012124649.BFAFE600174@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv23720 Modified Files: Tag: kolab_2_2_branch ChangeLog Log Message: Unified formatting. Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.7 retrieving revision 1.10.2.8 diff -u -d -r1.10.2.7 -r1.10.2.8 --- ChangeLog 9 Oct 2009 16:11:50 -0000 1.10.2.7 +++ ChangeLog 12 Oct 2009 12:46:47 -0000 1.10.2.8 @@ -10,20 +10,17 @@ 2009-09-10 Gunnar Wrobel

* kolab-webclient.spec: - kolab/issue3555 (unable to save filter settings more than once) 2009-09-09 Gunnar Wrobel

- * webclient-kronolith-kolab-conf.template: - + * webclient-kronolith-kolab-conf.template: kolab/issue3509 (calender not displaying in horde if german holidays are selected) 2009-05-13 Gunnar Wrobel

* kolab-webclient.spec: - kolab/issue3420 (web client prefs and hooks should be configurable via templates) @@ -43,7 +40,7 @@ 2008-02-07 Mathieu Parent * webclient-kolab-conf.template, webclient-kronolith-kolab-conf.template: - dist_conf configuration in kolab webclient templates (kolab/issue3387) + dist_conf configuration in kolab webclient templates (kolab/issue3387) 2009-01-08 Gunnar Wrobel

From cvs at kolab.org Mon Oct 12 16:09:02 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 16:09:02 +0200 (CEST) Subject: wilde: server/kolabd/kolabd/templates httpd.conf.template.in, 1.28, 1.28.2.1 Message-ID: <20091012140902.9353E600800@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolabd/kolabd/templates In directory doto:/tmp/cvs-serv28743/kolabd/kolabd/templates Modified Files: Tag: kolab_2_2_branch httpd.conf.template.in Log Message: Added anonymous ICS export. (Merged from suc branch) Index: httpd.conf.template.in =================================================================== RCS file: /kolabrepository/server/kolabd/kolabd/templates/httpd.conf.template.in,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -u -d -r1.28 -r1.28.2.1 --- httpd.conf.template.in 3 Mar 2009 16:59:00 -0000 1.28 +++ httpd.conf.template.in 12 Oct 2009 14:09:00 -0000 1.28.2.1 @@ -191,6 +191,8 @@ Alias /icons/ "@webserver_document_root@/icons/" +Alias /public-cal/ics "@webserver_document_root@/client/kronolith/ics_kolab.php" + Options Indexes MultiViews AllowOverride None From cvs at kolab.org Mon Oct 12 16:09:02 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 16:09:02 +0200 (CEST) Subject: wilde: server/kolab-webclient ChangeLog,1.10.2.8,1.10.2.9 Message-ID: <20091012140902.946D0600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv28743/kolab-webclient Modified Files: Tag: kolab_2_2_branch ChangeLog Log Message: Added anonymous ICS export. (Merged from suc branch) Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.8 retrieving revision 1.10.2.9 diff -u -d -r1.10.2.8 -r1.10.2.9 --- ChangeLog 12 Oct 2009 12:46:47 -0000 1.10.2.8 +++ ChangeLog 12 Oct 2009 14:09:00 -0000 1.10.2.9 @@ -18,6 +18,11 @@ kolab/issue3509 (calender not displaying in horde if german holidays are selected) +2009-05-28 Gunnar Wrobel

+ + * kolab-webclient.spec: Added functionality for anonymous + ics (iCal data) download. + 2009-05-13 Gunnar Wrobel

* kolab-webclient.spec: From cvs at kolab.org Mon Oct 12 16:09:02 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 16:09:02 +0200 (CEST) Subject: wilde: server release-notes.txt,1.398.2.56,1.398.2.57 Message-ID: <20091012140902.CCEA9600800@lists.intevation.de> Author: wilde Update of /kolabrepository/server In directory doto:/tmp/cvs-serv28743 Modified Files: Tag: kolab_2_2_branch release-notes.txt Log Message: Added anonymous ICS export. (Merged from suc branch) Index: release-notes.txt =================================================================== RCS file: /kolabrepository/server/release-notes.txt,v retrieving revision 1.398.2.56 retrieving revision 1.398.2.57 diff -u -d -r1.398.2.56 -r1.398.2.57 --- release-notes.txt 9 Oct 2009 16:11:50 -0000 1.398.2.56 +++ release-notes.txt 12 Oct 2009 14:09:00 -0000 1.398.2.57 @@ -68,6 +68,9 @@ party sites using the new client/kronolith/imple_kolab.php feature. + Calendars accessible for the proxy user can be anonymously + downloaded as ics files. + kolab/issue3509 (calender not displaying in horde if german holidays are selected) kolab/issue3555 (unable to save filter settings more than once) From cvs at kolab.org Mon Oct 12 16:09:03 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 16:09:03 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_GW_AnonymousiCalDownload.diff, NONE, 1.1.4.1 series, 1.5.2.5, 1.5.2.6 Message-ID: <20091012140903.4B000600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv28743/patches/horde-webmail/1.2.0/tg Modified Files: Tag: kolab_2_2_branch series Added Files: Tag: kolab_2_2_branch t_kronolith_HK_GW_AnonymousiCalDownload.diff Log Message: Added anonymous ICS export. (Merged from suc branch) --- NEW FILE: t_kronolith_HK_GW_AnonymousiCalDownload.diff --- From: Gunnar Wrobel

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

--- horde-webmail/config/kolab.php | 4 + horde-webmail/kronolith/ics_kolab.php | 110 +++++++++++++++++++++++++++++++++ 2 files changed, 114 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..2b81832 --- /dev/null +++ b/horde-webmail/kronolith/ics_kolab.php @@ -0,0 +1,110 @@ + + */ + +function logout() +{ + Auth::clearAuth(); + @session_destroy(); +} + + at define('AUTH_HANDLER', true); + at 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']; + $proxied = true; + } +} 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; +} + + at 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'; + if ($proxied) { + logout(); + } + 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; + } + $iCalEvent = $event->toiCalendar($iCal); + if (!empty($conf['ics']['hide_organizer'])) { + $iCalEvent->removeAttribute('ORGANIZER'); + } + $iCal->addComponent($iCalEvent); + } + + $ics = $iCal->exportvCalendar(); + $cache->set($key, $ics); +} + +$browser->downloadHeaders($calendar . '.ics', + 'text/calendar; charset=' . NLS::getCharset(), + true, + strlen($ics)); +echo $ics; + +if ($proxied) { + logout(); +} -- tg: (b5749f0..) t/kronolith/HK/GW/AnonymousiCalDownload (depends on: t/dimp/H/GW/AclView) -- TOPGIT patch commit log ======================= commit 4ac58a4d646865d74ac26c0439f29ceacfdfea82 Author: Gunnar Wrobel

Date: Thu Jun 4 09:40:25 2009 +0200 Allow to hide the organizer. commit 0df1aefd621efbe8a2d7e306fbc79dace5760280 Author: Gunnar Wrobel

Date: Thu May 28 12:42:44 2009 +0200 First version of the anonymous ics download patch. Index: series =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/series,v retrieving revision 1.5.2.5 retrieving revision 1.5.2.6 diff -u -d -r1.5.2.5 -r1.5.2.6 --- series 9 Oct 2009 16:11:51 -0000 1.5.2.5 +++ series 12 Oct 2009 14:09:01 -0000 1.5.2.6 @@ -69,4 +69,5 @@ t_imp_H_MS_bug7438.diff -p1 t_Kolab__Format_HK_GW_HandleEmptyXmlParserReturn.diff -p1 t_framework_HK_GW_Prefs_FileDriverHotfix.diff -p1 +t_kronolith_HK_GW_AnonymousiCalDownload.diff -p1 t_kronolith_HK_GW_ExportEventList.diff -p1 From cvs at kolab.org Mon Oct 12 16:09:03 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 16:09:03 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.11, 1.32.2.12 Message-ID: <20091012140903.E7EC360081B@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv28743/patches/horde-webmail/1.2.0 Modified Files: Tag: kolab_2_2_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Added anonymous ICS export. (Merged from suc branch) Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.11 retrieving revision 1.32.2.12 diff -u -d -r1.32.2.11 -r1.32.2.12 --- horde-webmail-1.2.0_kolab_openpkg.patch 9 Oct 2009 16:11:51 -0000 1.32.2.11 +++ horde-webmail-1.2.0_kolab_openpkg.patch 12 Oct 2009 14:09:00 -0000 1.32.2.12 @@ -20022,6 +20022,170 @@ } From: Gunnar Wrobel

+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

+ +--- + horde-webmail/config/kolab.php | 4 + + horde-webmail/kronolith/ics_kolab.php | 110 +++++++++++++++++++++++++++++++++ + 2 files changed, 114 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..2b81832 +--- /dev/null ++++ b/horde-webmail/kronolith/ics_kolab.php +@@ -0,0 +1,110 @@ ++ ++ */ ++ ++function logout() ++{ ++ Auth::clearAuth(); ++ @session_destroy(); ++} ++ ++ at define('AUTH_HANDLER', true); ++ at 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']; ++ $proxied = true; ++ } ++} 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; ++} ++ ++ at 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'; ++ if ($proxied) { ++ logout(); ++ } ++ 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; ++ } ++ $iCalEvent = $event->toiCalendar($iCal); ++ if (!empty($conf['ics']['hide_organizer'])) { ++ $iCalEvent->removeAttribute('ORGANIZER'); ++ } ++ $iCal->addComponent($iCalEvent); ++ } ++ ++ $ics = $iCal->exportvCalendar(); ++ $cache->set($key, $ics); ++} ++ ++$browser->downloadHeaders($calendar . '.ics', ++ 'text/calendar; charset=' . NLS::getCharset(), ++ true, ++ strlen($ics)); ++echo $ics; ++ ++if ($proxied) { ++ logout(); ++} +-- +tg: (b5749f0..) t/kronolith/HK/GW/AnonymousiCalDownload (depends on: t/dimp/H/GW/AclView) +-- +TOPGIT patch commit log +======================= + +commit 4ac58a4d646865d74ac26c0439f29ceacfdfea82 +Author: Gunnar Wrobel

+Date: Thu Jun 4 09:40:25 2009 +0200 + + Allow to hide the organizer. + +commit 0df1aefd621efbe8a2d7e306fbc79dace5760280 +Author: Gunnar Wrobel

+Date: Thu May 28 12:42:44 2009 +0200 + + First version of the anonymous ics download patch. +From: Gunnar Wrobel

Subject: [PATCH] t/kronolith/HK/GW/ExportEventList Export a list of events. From cvs at kolab.org Mon Oct 12 16:27:30 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 16:27:30 +0200 (CEST) Subject: wilde: server/kolab-webclient kolab-webclient.spec, 1.23.2.11, 1.23.2.12 Message-ID: <20091012142730.82986600800@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv29164 Modified Files: Tag: kolab_2_2_branch kolab-webclient.spec Log Message: Bumped up version of kolab-webclient. Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.11 retrieving revision 1.23.2.12 diff -u -d -r1.23.2.11 -r1.23.2.12 --- kolab-webclient.spec 9 Oct 2009 16:11:50 -0000 1.23.2.11 +++ kolab-webclient.spec 12 Oct 2009 14:27:28 -0000 1.23.2.12 @@ -3,7 +3,7 @@ %define V_package kolab-webclient %define V_year 2009 %define V_month 10 -%define V_day 09 +%define V_day 12 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 From cvs at kolab.org Mon Oct 12 17:43:53 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 17:43:53 +0200 (CEST) Subject: richard: server/kolabd/kolabd/dist_conf suse,1.93,1.94 Message-ID: <20091012154353.C144E600800@lists.intevation.de> Author: richard Update of /kolabrepository/server/kolabd/kolabd/dist_conf In directory doto:/tmp/cvs-serv31702 Modified Files: suse Log Message: replace a bracket by a curly bracket Index: suse =================================================================== RCS file: /kolabrepository/server/kolabd/kolabd/dist_conf/suse,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- suse 27 Aug 2009 21:13:18 -0000 1.93 +++ suse 12 Oct 2009 15:43:51 -0000 1.94 @@ -85,7 +85,7 @@ kolab_pkgs=spamassassin openldap2 clamav amavisd-new postfix kolab apache2 kolab-server kolab-freebusy kolab-filter perl-kolab kolab-format kolab-webadmin kolab-storage kolab_smtpdpolicy_conffile_usr=wwwrun kolab_smtpdpolicy_conffile_grp=root -kolab_scriptsdir=$(datadir)/kolab/scripts +kolab_scriptsdir=${datadir}/kolab/scripts # This variable makes it possible to store all kolab php modules in its own # module. E.g on suse it will be /usr/share/php/kolab instead of just From cvs at kolab.org Mon Oct 12 18:02:16 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 18:02:16 +0200 (CEST) Subject: wilde: doc/raw-howtos anonymous-ics-export.txt,NONE,1.1 Message-ID: <20091012160216.2154B600800@lists.intevation.de> Author: wilde Update of /kolabrepository/doc/raw-howtos In directory doto:/tmp/cvs-serv32143 Added Files: anonymous-ics-export.txt Log Message: Minimal documentation for the new anonymous ICS export. --- NEW FILE: anonymous-ics-export.txt --- ------------------------------------------------------------------------ The anonymous ICS Calendar ------------------------------------------------------------------------ Sascha Wilde Since 2009/10/12 the CVS kolab_2_2_branch contains a new feature, allowing the anonymous (read: no authentication required) export of dedicated calendars as ics files. Concept: A dedicated "proxy" user is created and the id and password of this user is made known to certain parts of the webclient. The proxy user is granted read access to one or more calendar by regular Kolab users. An ics file with the exported events from one of the calendars accessible for the proxy user can be downloaded anonymously from the kolab server. Usage: 1. Create an new user account e.g. "proxy at example.com" with password "secret". 2. In /kolab/etc/kolab/templates/webclient-kolab-conf.template the lines $conf['ics']['default_user'] = 'proxy@@@@postfix-mydomain@@@'; $conf['ics']['default_pass'] = 'proxy'; must be uncommented and filled with the correct credentials a chosen in 1. 3. Grant list/read access for some calendar folders to the user "proxy at example.com". For example the user foo at example.com gives the proxy user access to his default calendar "Calendar" 4. Now anyone can retrieve the events from the users foo at example.com's calendar by downloading: http://kolab.example.com/public-cal/ics?c=user/foo/Calendar the url follows the pattern: http://KOLABSERVER/public-cal/ics?c=user/USERNAME/CALENDARNAME Security considerations: One should note, that the data from calendars shared to the proxy user is freely, world wide readable unless the access to the Kolab Webclient server is restricted by other means. From cvs at kolab.org Mon Oct 12 18:34:40 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Mon, 12 Oct 2009 18:34:40 +0200 (CEST) Subject: wilde: server/kolab-webclient kolab-webclient.spec, 1.23.2.12, 1.23.2.13 Message-ID: <20091012163440.15897600800@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv517 Modified Files: Tag: kolab_2_2_branch kolab-webclient.spec Log Message: Fore rebuild of web client translation files. (Merged from suc branch) Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.12 retrieving revision 1.23.2.13 diff -u -d -r1.23.2.12 -r1.23.2.13 --- kolab-webclient.spec 12 Oct 2009 14:27:28 -0000 1.23.2.12 +++ kolab-webclient.spec 12 Oct 2009 16:34:37 -0000 1.23.2.13 @@ -144,6 +144,10 @@ sed -i -e 's#@@@nag_confdir@@@#%{l_prefix}/var/kolab/www/client/nag/config#' $RPM_BUILD_ROOT%{l_prefix}/etc/kolab/templates/*.php.template sed -i -e 's#@@@turba_confdir@@@#%{l_prefix}/var/kolab/www/client/turba/config#' $RPM_BUILD_ROOT%{l_prefix}/etc/kolab/templates/*.php.template + # Refresh the translations + PATH="%{l_prefix}/bin" %{l_prefix}/bin/php -d safe_mode=0 -f $RPM_BUILD_ROOT%{l_prefix}/var/kolab/www/client/po/translation.php make --module dimp --no-compendium + PATH="%{l_prefix}/bin" %{l_prefix}/bin/php -d safe_mode=0 -f $RPM_BUILD_ROOT%{l_prefix}/var/kolab/www/client/po/translation.php make --module kronolith --no-compendium + %{l_shtool} install -c -m 644 %{l_value -s -a} %{S:4} %{S:5} \ $RPM_BUILD_ROOT%{l_prefix}/var/kolab/www/client/passwd/config From cvs at kolab.org Tue Oct 13 12:35:36 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 12:35:36 +0200 (CEST) Subject: wilde: server/php-kolab/Kolab_Server Makefile,1.6,1.6.2.1 Message-ID: <20091013103536.E494760081C@lists.intevation.de> Author: wilde Update of /kolabrepository/server/php-kolab/Kolab_Server In directory doto:/tmp/cvs-serv9261 Modified Files: Tag: kolab_2_2_branch Makefile Log Message: Merged improved Makefile from suc branch. Index: Makefile =================================================================== RCS file: /kolabrepository/server/php-kolab/Kolab_Server/Makefile,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- Makefile 24 Feb 2009 11:57:46 -0000 1.6 +++ Makefile 13 Oct 2009 10:35:34 -0000 1.6.2.1 @@ -1,50 +1,111 @@ -PACKAGE = $(shell grep "%define[ ]*V_package" *.spec | sed -e "s/.*V_package \([A-Za-z\-\_]*\).*/\1/") -VERSION = $(shell grep "%define[ ]*V_version" *.spec | sed -e "s/.*V_version\s*\([0-9.]*\).*/\1/") -RELEASE = $(shell grep "%define[ ]*V_release" *.spec | sed -e "s/.*V_release\s*\([0-9]*\).*/\1/") +# If home is unset this Makefile assumes the Kolab server installation +# resides in /kolab. If this is not the case this Makefile must be +# called using +# +# HOME="/mykolabroot" make TARGET +# +ifeq "x$(HOME)" "x" + HOME = /kolab +endif +# If HOME is set to /root it is likely that somebody is calling this +# Makefile as root user. In this case this Makefile assumes that the +# Kolab server installation resides in /kolab. +# +# In the (hopefully) unlikely event that somebody really installed the +# Kolab server in /root this Makefile will fail. +ifeq "x$(HOME)" "x/root" + HOME = /kolab +endif + +# Set the location of the rpm binary ifeq "x$(RPM)" "x" RPM = $(HOME)/bin/openpkg rpm endif + +# Set the location for rpm source package installations ifeq "x$(KOLABRPMSRC)" "x" KOLABRPMSRC = $(HOME)/RPM/SRC endif + +# Set the location for rpm packages ifeq "x$(KOLABRPMPKG)" "x" KOLABRPMPKG = $(HOME)/RPM/PKG endif + +# Set the location for the rpm temporary directory ifeq "x$(KOLABRPMTMP)" "x" KOLABRPMTMP = $(HOME)/RPM/TMP endif +# Determine the suffix for binary packages on this system ifeq "x$(PLATTAG)" "x" PLATTAG = $(shell $(RPM) -q --qf="%{ARCH}-%{OS}" openpkg)-$(HOME:/%=%) endif -SOURCE_URL=http://pear.horde.org/get +# Determine the staging area for collecting new source rpms +ifeq "x$(STAGING)" "x" + STAGING = ../../stage +endif + +# Determine the package name from the *.spec file +PACKAGE = $(shell grep "%define[ ]*V_package" *.spec | sed -e "s/.*V_package \([A-Za-z\-\_]*\).*/\1/") + +# Determine the package version from the *.spec file +VERSION = $(shell grep "%define[ ]*V_version" *.spec | sed -e "s/.*V_version\s*\([0-9.]*\).*/\1/") + +# Determine the release number from the *.spec file +RELEASE = $(shell grep "%define[ ]*V_release" *.spec | sed -e "s/.*V_release\s*\([0-9]*\).*/\1/") + +# Determine the download url for the PEAR package from the *.spec file +SOURCE_URL=$(shell grep "%define[ ]*V_sourceurl" *.spec | sed -e "s/.*V_sourceurl\s*\(.*\)/\1/") + +# Get the list of patches if there are any in this directory +PATCHES = $(shell ls *.patch 2> /dev/null) + +# Generate the full package name SOURCE_0=$(PACKAGE)-$(VERSION).tgz +# Generate a list of extra files for the package +EXTRA=ChangeLog $(PATCHES) + + +# Default target to generate the source rpm package .PHONY: all all: $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm +# Target for placing the source rpm in the staging area .PHONY: dist dist: all - cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm ../../stage/ + test -d $(STAGING) || mkdir $(STAGING) + cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm $(STAGING) -.PHONY: clean -clean: - rm -rf /kolab/RPM/TMP/$(PACKAGE)* - rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm - rm -rf *~ +# Target for installing the binary rpm package in our current Kolab +# server installation +.PHONY: install +install: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm + $(RPM) -Uhv --force $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm -$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0): +# Target for retrieving the source package +$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0): test -d $(KOLABRPMSRC)/$(PACKAGE) || mkdir $(KOLABRPMSRC)/$(PACKAGE) cd $(KOLABRPMSRC)/$(PACKAGE) && wget -c "$(SOURCE_URL)/$(SOURCE_0)" -$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm: Makefile $(PACKAGE).spec ChangeLog $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0) - cp $(PACKAGE).spec $(KOLABRPMSRC)/$(PACKAGE) +# Target for preparing the source area and building the package +$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm: Makefile $(PACKAGE).spec $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0) + cp $(PACKAGE).spec $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE) cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -ba $(PACKAGE).spec +# Target for fetching the source rpm into the current directory +$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm cp -p $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm . -.PHONY: install -install: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm - $(RPM) -Uhv --force $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm +# Target for cleaning up the files that can be generated with this Makefile +.PHONY: clean +clean: + rm -rf $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm + rm -rf $(KOLABRPMSRC)/$(PACKAGE) + rm -rf $(KOLABRPMTMP)/$(PACKAGE)* + rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm + rm -rf *~ + From cvs at kolab.org Tue Oct 13 14:37:29 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 14:37:29 +0200 (CEST) Subject: wilde: server/kolabd/kolabd ChangeLog,1.234.2.9,1.234.2.10 Message-ID: <20091013123729.D3F33600174@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolabd/kolabd In directory doto:/tmp/cvs-serv13310/kolabd/kolabd Modified Files: Tag: kolab_2_2_branch ChangeLog Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolabd/kolabd/ChangeLog,v retrieving revision 1.234.2.9 retrieving revision 1.234.2.10 diff -u -d -r1.234.2.9 -r1.234.2.10 --- ChangeLog 14 May 2009 10:52:35 -0000 1.234.2.9 +++ ChangeLog 13 Oct 2009 12:37:27 -0000 1.234.2.10 @@ -12,6 +12,14 @@ Updated templates for clamav-0.95.1-20090409 for kolab/issue3513 (Clamav - new upstream version 0.95.1) +2009-04-23 Gunnar Wrobel

+ + * templates/freebusy.conf.template.in: Configuration support for + LDAP attribute mapping. + + * templates/resmgr.conf.template.in: Configuration support for + LDAP attribute mapping. + 2009-04-20 Thomas Arendsen Hein * templates/slapd.conf.template.in: Make kolabAllowSMTPRecipient From cvs at kolab.org Tue Oct 13 14:37:29 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 14:37:29 +0200 (CEST) Subject: wilde: server/kolab-webclient ChangeLog, 1.10.2.9, 1.10.2.10 kolab-webclient.spec, 1.23.2.13, 1.23.2.14 webclient-kolab-conf.template, 1.2.2.1, 1.2.2.2 Message-ID: <20091013123729.B7ABF600174@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv13310/kolab-webclient Modified Files: Tag: kolab_2_2_branch ChangeLog kolab-webclient.spec webclient-kolab-conf.template Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.9 retrieving revision 1.10.2.10 diff -u -d -r1.10.2.9 -r1.10.2.10 --- ChangeLog 12 Oct 2009 14:09:00 -0000 1.10.2.9 +++ ChangeLog 13 Oct 2009 12:37:27 -0000 1.10.2.10 @@ -29,6 +29,17 @@ kolab/issue3420 (web client prefs and hooks should be configurable via templates) +2009-04-24 Gunnar Wrobel

+ + * kolab-webclient.spec: Additional fixes for configurable mapping + of LDAP attributes. + +2009-04-23 Gunnar Wrobel

+ + * kolab-webclient.spec: Support for configurable mapping of LDAP + attributes. + + 2009-04-02 Gunnar Wrobel

* kolab-webclient.spec: @@ -44,7 +55,7 @@ 2008-02-07 Mathieu Parent - * webclient-kolab-conf.template, webclient-kronolith-kolab-conf.template: + * webclient-kolab-conf.template, webclient-kronolith-kolab-conf.template: dist_conf configuration in kolab webclient templates (kolab/issue3387) 2009-01-08 Gunnar Wrobel

Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.13 retrieving revision 1.23.2.14 diff -u -d -r1.23.2.13 -r1.23.2.14 --- kolab-webclient.spec 12 Oct 2009 16:34:37 -0000 1.23.2.13 +++ kolab-webclient.spec 13 Oct 2009 12:37:27 -0000 1.23.2.14 @@ -3,7 +3,7 @@ %define V_package kolab-webclient %define V_year 2009 %define V_month 10 -%define V_day 12 +%define V_day 13 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 Index: webclient-kolab-conf.template =================================================================== RCS file: /kolabrepository/server/kolab-webclient/webclient-kolab-conf.template,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -d -r1.2.2.1 -r1.2.2.2 --- webclient-kolab-conf.template 9 Oct 2009 16:11:51 -0000 1.2.2.1 +++ webclient-kolab-conf.template 13 Oct 2009 12:37:27 -0000 1.2.2.2 @@ -19,6 +19,24 @@ @@@endif@@@ $conf['kolab']['imap']['maildomain'] = '@@@postfix-mydomain@@@'; +/** + * If you use customized LDAP attributes on your LDAP server the + * following configuration setting allows you to map the standard + * Kolab attribute names to your customizations. + * + * Specify the mapping line by line: + * + * $conf['kolab']['ldap']['map']['uid'] = 'uid2'; + * $conf['kolab']['ldap']['map']['mobile'] = 'handy'; + * + * or use a hash structure: + * + * $conf['kolab']['ldap']['map'] = array('uid' => 'uid2', + * 'mobile' => 'handy'); + * + */ +//$conf['kolab']['ldap']['map']['uid'] = 'uid2'; + /* Credentials for a proxy user to allow quasi anonymous ICS access * via /public-cal/ics. You will need to create this user first. */ From cvs at kolab.org Tue Oct 13 14:37:30 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 14:37:30 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/tg t_pear_HK_GW_AddNetLDAP2.diff, NONE, 1.1.4.1 series, 1.5.2.6, 1.5.2.7 Message-ID: <20091013123730.C2B23600805@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv13310/patches/horde-webmail/1.2.0/tg Modified Files: Tag: kolab_2_2_branch series Added Files: Tag: kolab_2_2_branch t_pear_HK_GW_AddNetLDAP2.diff Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) --- NEW FILE: t_pear_HK_GW_AddNetLDAP2.diff --- From: Gunnar Wrobel

Subject: [PATCH] t/pear/HK/GW/AddNetLDAP2 Adds the PEAR-Net_LDAP2 library. Signed-off-by: Gunnar Wrobel

--- horde-webmail/pear/Net/LDAP2.php | 1698 ++++++++++++++++++++++++++++++ horde-webmail/pear/Net/LDAP2/Entry.php | 1019 ++++++++++++++++++ horde-webmail/pear/Net/LDAP2/Filter.php | 447 ++++++++ horde-webmail/pear/Net/LDAP2/LDIF.php | 904 ++++++++++++++++ horde-webmail/pear/Net/LDAP2/RootDSE.php | 221 ++++ horde-webmail/pear/Net/LDAP2/Schema.php | 502 +++++++++ horde-webmail/pear/Net/LDAP2/Search.php | 596 +++++++++++ horde-webmail/pear/Net/LDAP2/Util.php | 557 ++++++++++ 8 files changed, 5944 insertions(+), 0 deletions(-) diff --git a/horde-webmail/pear/Net/LDAP2.php b/horde-webmail/pear/Net/LDAP2.php [...5988 lines suppressed...] + } + } + } + return array_values($dn); + } +} + +?> \ No newline at end of file -- tg: (031aea6..) t/pear/HK/GW/AddNetLDAP2 (depends on: t/dimp/H/GW/AclView) -- TOPGIT patch commit log ======================= commit 0ad87da8cf55073240d541edea74e6a60bbe3695 Author: Gunnar Wrobel

Date: Thu Apr 23 13:41:35 2009 +0200 Add PEAR-Net_LDAP2 Index: series =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/series,v retrieving revision 1.5.2.6 retrieving revision 1.5.2.7 diff -u -d -r1.5.2.6 -r1.5.2.7 --- series 12 Oct 2009 14:09:01 -0000 1.5.2.6 +++ series 13 Oct 2009 12:37:27 -0000 1.5.2.7 @@ -68,6 +68,7 @@ t_imp_H_JS_bug7739.diff -p1 t_imp_H_MS_bug7438.diff -p1 t_Kolab__Format_HK_GW_HandleEmptyXmlParserReturn.diff -p1 +t_pear_HK_GW_AddNetLDAP2.diff -p1 t_framework_HK_GW_Prefs_FileDriverHotfix.diff -p1 t_kronolith_HK_GW_AnonymousiCalDownload.diff -p1 t_kronolith_HK_GW_ExportEventList.diff -p1 From cvs at kolab.org Tue Oct 13 14:37:30 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 14:37:30 +0200 (CEST) Subject: wilde: server/php-kolab/Kolab_Server mapping.patch, NONE, 1.1.4.1 ChangeLog, 1.4, 1.4.2.1 Kolab_Server.spec, 1.9, 1.9.2.1 Message-ID: <20091013123730.BE425600175@lists.intevation.de> Author: wilde Update of /kolabrepository/server/php-kolab/Kolab_Server In directory doto:/tmp/cvs-serv13310/php-kolab/Kolab_Server Modified Files: Tag: kolab_2_2_branch ChangeLog Kolab_Server.spec Added Files: Tag: kolab_2_2_branch mapping.patch Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) --- NEW FILE: mapping.patch --- diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server.php b/framework/Kolab_Server/lib/Horde/Kolab/Server.php index 941cbe6..4d77f11 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server.php @@ -159,9 +159,12 @@ class Horde_Kolab_Server { $driver = 'ldap'; $server_params = array('server' => $conf['kolab']['ldap']['server'], - 'base_dn' => $conf['kolab']['ldap']['basedn'], - 'uid' => $conf['kolab']['ldap']['phpdn'], - 'pass' => $conf['kolab']['ldap']['phppw']); + 'base_dn' => $conf['kolab']['ldap']['basedn'], + 'uid' => $conf['kolab']['ldap']['phpdn'], + 'pass' => $conf['kolab']['ldap']['phppw']); + if (isset($conf['kolab']['ldap']['map'])) { + $server_params['map'] = $conf['kolab']['ldap']['map']; + } } else { $driver = null; $server_params = array(); @@ -473,7 +476,7 @@ class Horde_Kolab_Server { function uidForId($id, $restrict = KOLAB_SERVER_RESULT_SINGLE) { - return $this->uidForAttr('uid', $id); + return $this->uidForAttr(KOLAB_ATTR_SID, $id); } /** @@ -513,7 +516,7 @@ class Horde_Kolab_Server { */ function uidForIdOrMail($id) { - $uid = $this->uidForAttr('uid', $id); + $uid = $this->uidForAttr(KOLAB_ATTR_SID, $id); if (!$uid) { $uid = $this->uidForAttr('mail', $id); } @@ -562,7 +565,7 @@ class Horde_Kolab_Server { */ function uidForMailOrIdOrAlias($id) { - $uid = $this->uidForAttr('uid', $id); + $uid = $this->uidForAttr(KOLAB_ATTR_SID, $id); if (!$uid) { $uid = $this->uidForAttr('mail', $id); if (!$uid) { diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php index 2b1237c..27993cc 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php @@ -26,6 +26,7 @@ define('KOLAB_OBJECT_USER', 'Horde_Kolab_Server_Object_user'); define('KOLAB_OBJECT_SERVER', 'Horde_Kolab_Server_Object_server'); /** Define the possible Kolab object attributes */ +define('KOLAB_ATTR_OC', 'objectClass'); define('KOLAB_ATTR_UID', 'dn'); define('KOLAB_ATTR_ID', 'id'); define('KOLAB_ATTR_SN', 'sn'); @@ -35,6 +36,7 @@ define('KOLAB_ATTR_FN', 'fn'); define('KOLAB_ATTR_LNFN', 'lnfn'); define('KOLAB_ATTR_FNLN', 'fnln'); define('KOLAB_ATTR_MAIL', 'mail'); +define('KOLAB_ATTR_ALIAS', 'alias'); define('KOLAB_ATTR_SID', 'uid'); define('KOLAB_ATTR_ACL', 'acl'); define('KOLAB_ATTR_MEMBER', 'member'); diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/address.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/address.php index 697a0c0..59d9ad4 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/address.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/address.php @@ -33,13 +33,6 @@ class Horde_Kolab_Server_Object_address extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(objectclass=inetOrgPerson)(!(uid=*))(sn=*))'; - - /** * The attributes supported by this class * * @var array @@ -86,6 +79,32 @@ class Horde_Kolab_Server_Object_address extends Horde_Kolab_Server_Object { ); /** + * The LDAP filter to retrieve this object type + * + * @return string + */ + function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_SN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_INETORGPERSON), + array('NOT' => array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => '*'), + ), + ), + ), + ); + return $criteria; + } + + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/adminrole.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/adminrole.php index cebfba2..f0b9f46 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/adminrole.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/adminrole.php @@ -32,13 +32,6 @@ class Horde_Kolab_Server_Object_adminrole extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(cn=*)(objectClass=inetOrgPerson)(!(uid=manager))(sn=*))'; - - /** * The attributes supported by this class * * @var array @@ -87,6 +80,34 @@ class Horde_Kolab_Server_Object_adminrole extends Horde_Kolab_Server_Object { ); /** + * The LDAP filter to retrieve this object type + * + * @return string + */ + function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_CN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_SN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_INETORGPERSON), + array('NOT' => array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => 'manager'), + ), + ), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/distlist.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/distlist.php index e2c1c3e..04889b0 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/distlist.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/distlist.php @@ -34,14 +34,6 @@ require_once 'Horde/Kolab/Server/Object/group.php'; class Horde_Kolab_Server_Object_distlist extends Horde_Kolab_Server_Object_group { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(objectClass=kolabGroupOfNames)(mail=*))'; - - - /** * The attributes required when creating an object of this class. * * @var array @@ -49,4 +41,26 @@ class Horde_Kolab_Server_Object_distlist extends Horde_Kolab_Server_Object_group var $_required_attributes = array( KOLAB_ATTR_MAIL, ); + + /** + * Return the filter string to retrieve this object type. + * + * @static + * + * @return string The filter to retrieve this object type from the server + * database. + */ + public static function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABGROUPOFNAMES), + ), + ); + return $criteria; + } }; diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/group.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/group.php index e72604a..ea3d370 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/group.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/group.php @@ -32,13 +32,6 @@ class Horde_Kolab_Server_Object_group extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(objectClass=kolabGroupOfNames)'; - - /** * The attributes supported by this class * * @var array @@ -104,6 +97,22 @@ class Horde_Kolab_Server_Object_group extends Horde_Kolab_Server_Object { } /** + * Return the filter string to retrieve this object type. + * + * @return string The filter to retrieve this object type from the server + * database. + */ + public static function getFilter() + { + $criteria = array('AND' => array(array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABGROUPOFNAMES), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/server.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/server.php index 23549d5..b52a587 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/server.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/server.php @@ -32,11 +32,26 @@ class Horde_Kolab_Server_Object_server extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type + * Return the filter string to retrieve this object type. * - * @var string + * @static + * + * @return string The filter to retrieve this object type from the server + * database. */ - var $filter = '(&((k=kolab))(objectclass=kolab))'; + public static function getFilter() + { + $criteria = array('AND' => array( + array('field' => 'k', + 'op' => '=', + 'test' => 'kolab'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLAB), + ), + ); + return $criteria; + } /** * The attributes supported by this class diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/sharedfolder.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/sharedfolder.php index 81a68f6..ea8994b 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/sharedfolder.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/sharedfolder.php @@ -33,13 +33,6 @@ class Horde_Kolab_Server_Object_sharedfolder extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(objectClass=kolabSharedFolder)'; - - /** * The attributes supported by this class * * @var array @@ -89,6 +82,22 @@ class Horde_Kolab_Server_Object_sharedfolder extends Horde_Kolab_Server_Object { } /** + * Return the filter string to retrieve this object type. + * + * @return string The filter to retrieve this object type from the server + * database. + */ + public static function getFilter() + { + $criteria = array('AND' => array(array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABSHAREDFOLDER), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php index a02b7fe..c648f65 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php @@ -33,13 +33,6 @@ class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(objectClass=kolabInetOrgPerson)(uid=*)(mail=*)(sn=*))'; - - /** * The attributes supported by this class * * @var array @@ -154,6 +147,31 @@ class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object { } /** + * The LDAP filter to retrieve this object type + * + * @return string + */ + function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_SN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php index eee8f52..ea73b4f 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php @@ -210,6 +210,7 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } if (isset($attrs)) { + $this->mapKeys($attrs); $result = @ldap_read($this->_connection, $dn, '(objectclass=*)', $attrs); } else { $result = @ldap_read($this->_connection, $dn, '(objectclass=*)'); @@ -220,7 +221,7 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } $entry = $this->_firstEntry($result); if (!$entry) { - ldap_free_result($result); + @ldap_free_result($result); return PEAR::raiseError(sprintf(_("LDAP Error: Empty result for: %s."), $dn)); } @@ -229,7 +230,10 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { return PEAR::raiseError(sprintf(_("LDAP Error: No such dn: %s: %s"), $dn, $this->_error())); } - ldap_free_result($result); + @ldap_free_result($result); + + $this->unmapAttributes($object); + return $object; } @@ -250,6 +254,8 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } } + $this->mapAttributes($data); + return @ldap_add($this->_connection, $dn, $data); } @@ -681,9 +687,25 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function mailForIdOrMail($id) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. - Horde_LDAP::quote($id) . ')(mail=' . - Horde_LDAP::quote($id) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $id), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $id), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); + $result = $this->_attrsForFilter($filter, array('mail'), KOLAB_SERVER_RESULT_STRICT); if (is_a($result, 'PEAR_Error')) { @@ -702,9 +724,24 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function uidForIdOrMail($id) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. - Horde_LDAP::quote($id) . ')(mail=' . - Horde_LDAP::quote($id) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $id), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $id), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter, KOLAB_SERVER_RESULT_STRICT); } @@ -717,9 +754,25 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function addrsForIdOrMail($id) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(mail=' - . Horde_LDAP::quote($id) . ')(uid=' - . Horde_LDAP::quote($id) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $id), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $id), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); + $result = $this->_attrsForFilter($filter, array('mail', 'alias'), KOLAB_SERVER_RESULT_STRICT); if (empty($result)) { @@ -768,10 +821,27 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function uidForMailAddress($mail) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. - Horde_LDAP::quote($mail) . ')(mail=' . - Horde_LDAP::quote($mail) . ')(alias=' . - Horde_LDAP::quote($mail) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_ALIAS, + 'op' => '=', + 'test' => $mail), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $mail), + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $mail), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter); } @@ -788,8 +858,17 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { function uidForAttr($attr, $value, $restrict = KOLAB_SERVER_RESULT_SINGLE) { - $filter = '(&(objectClass=kolabInetOrgPerson)(' . $attr . - '=' . Horde_LDAP::quote($value) . '))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('field' => $attr, + 'op' => '=', + 'test' => $value), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter, $restrict); } @@ -806,8 +885,17 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { function gidForAttr($attr, $value, $restrict = KOLAB_SERVER_RESULT_SINGLE) { - $filter = '(&(objectClass=kolabGroupOfNames)(' . $attr . - '=' . Horde_LDAP::quote($value) . '))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABGROUPOFNAMES), + array('field' => $attr, + 'op' => '=', + 'test' => $value), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter, $restrict); } @@ -874,7 +962,13 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { return $result; } $vars = get_class_vars($type); - $filter = $vars['filter']; + $methods = get_class_methods($type); + if (!in_array('getFilter', $methods)) { + $filter = $vars['filter']; + } else { + $criteria = call_user_func(array($type, 'getFilter')); + $filter = $this->searchQuery($criteria); + } $sort = $vars['sort_by']; if (isset($params['sort'])) { @@ -993,4 +1087,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } } + /** + * Build a search query. + * + * Taken from the Turba LDAP driver. + * + * @param array $criteria The array of criteria. + * + * @return string An LDAP query filter. + */ + public function searchQuery($criteria) + { + require_once 'Net/LDAP2.php'; + + /* Accept everything. */ + $filter = '(' . strtolower(KOLAB_ATTR_OC) . '=*)'; + + /* Build the LDAP filter. */ + if (count($criteria)) { + $f = $this->buildSearchQuery($criteria); + if (is_a($f, 'Net_LDAP2_Filter')) { + $filter = $f->asString(); + } + } + return $filter; + } + + /** + * Build a piece of a search query. + * + * Taken from the Turba LDAP driver. + * + * @param array $criteria The array of criteria. + * + * @return string An LDAP query fragment. + */ + protected function &buildSearchQuery($criteria) + { + if (isset($criteria['field'])) { + require_once 'Horde/String.php'; + require_once 'Horde/NLS.php'; + $rhs = $criteria['test']; + /* Keep this in for reference as we did not really test servers with different encoding yet */ + //$rhs = String::convertCharset($criteria['test'], NLS::getCharset(), $this->params['charset']); + switch ($criteria['op']) { + case '=': + $op = 'equals'; + break; + } + return Net_LDAP2_Filter::create($this->mapField($criteria['field']), + $op, $rhs); + } + foreach ($criteria as $key => $vals) { + if (!empty($vals['OR']) + || !empty($vals['AND']) + || !empty($vals['NOT'])) { + $parts = $this->buildSearchQuery($vals); + if (count($parts) > 1) { + if (!empty($vals['OR'])) { + $operator = '|'; + } else if (!empty($vals['NOT'])) { + $operator = '!'; + } else { + $operator = '&'; + } + return Net_LDAP2_Filter::combine($operator, $parts); + } else { + return $parts[0]; + } + } else { + $parts = array(); + foreach ($vals as $test) { + $parts[] = &$this->buildSearchQuery($test); + } + switch ($key) { + case 'OR': + $operator = '|'; + break; + case 'AND': + $operator = '&'; + break; + case 'NOT': + $operator = '!'; + break; + } + if (count($parts) > 1) { + return Net_LDAP2_Filter::combine($operator, $parts); + } else if ($operator == '!') { + return Net_LDAP2_Filter::combine($operator, $parts[0]); + } else { + return $parts[0]; + } + } + } + } + + /** + * Map attributes defined within this library their their real world + * counterparts. + * + * @param array $data The data that has been read and needs to be mapped. + * + * @return NULL + */ + protected function unmapAttributes(&$data) + { + if (!empty($this->_params['map'])) { + foreach ($this->_params['map'] as $attribute => $map) { + if (isset($data[$map])) { + $data[$attribute] = $data[$map]; + unset($data[$map]); + } + } + } + } + + /** + * Map attributes defined within this library into their real world + * counterparts. + * + * @param array $data The data to be written. + * + * @return NULL + */ + protected function mapAttributes(&$data) + { + if (!empty($this->_params['map'])) { + foreach ($this->_params['map'] as $attribute => $map) { + if (isset($data[$attribute])) { + $data[$map] = $data[$attribute]; + unset($data[$attribute]); + } + } + } + } + + /** + * Map attribute keys defined within this library into their real world + * counterparts. + * + * @param array $keys The attribute keys. + * + * @return NULL + */ + protected function mapKeys(&$keys) + { + if (!empty($this->_params['map'])) { + foreach ($this->_params['map'] as $attribute => $map) { + $key = array_search($attribute, $keys); + if ($key !== false) { + $keys[$key] = $map; + } + } + } + } + + /** + * Map a single attribute key defined within this library into its real + * world counterpart. + * + * @param array $field The attribute name. + * + * @return The real name of this attribute on the server we connect to. + */ + protected function mapField($field) + { + if (!empty($this->_params['map']) + && isset($this->_params['map'][$field])) { + return $this->_params['map'][$field]; + } + return $field; + } + } diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/test.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/test.php index 0127069..8d6d522 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/test.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/test.php @@ -247,6 +247,10 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { } } + if (!empty($attributes)) { + $this->mapKeys($attributes); + } + $filter = $this->_parse($filter); if (is_a($filter, 'PEAR_Error')) { return $filter; @@ -265,6 +269,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { $result = $subtree; } + $this->unmapAttributes($result); + return $result; } @@ -286,7 +292,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { switch ($filter['log']) { case '=': $value = $element['data'][$filter['att']]; - if (($filter['val'] == '*' && !empty($value)) + if ((($filter['val'] == '*' || $filter['val'] == '\2a') + && !empty($value)) || $value == $filter['val'] || (is_array($value) && in_array($filter['val'], $value))) { @@ -390,8 +397,12 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { $dn)); } if (empty($attrs)) { - return $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; + $data = $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; + $this->unmapAttributes($data); + return $data; } else { + $this->mapKeys($attrs); + $result = array(); $data = $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; @@ -401,6 +412,9 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { array_push($result, $attr); } } + + $this->unmapAttributes($result); + $result['count'] = 1; return $result; } @@ -423,6 +437,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { } } + $this->mapAttributes($data); + $ldap_data = array(); foreach ($data as $key => $val) { if (!is_array($val)) { Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/php-kolab/Kolab_Server/ChangeLog,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- ChangeLog 24 Feb 2009 11:57:46 -0000 1.4 +++ ChangeLog 13 Oct 2009 12:37:28 -0000 1.4.2.1 @@ -1,3 +1,13 @@ +2009-04-24 Gunnar Wrobel

+ + * Kolab_Server.spec: Additional fixes for configurable mapping of + LDAP attributes. + +2009-04-23 Gunnar Wrobel

+ + * Kolab_Server.spec: Support for configurable mapping of LDAP + attributes. + 2009-02-24 Gunnar Wrobel

* Kolab_Server.spec: Update to 0.4.0. Index: Kolab_Server.spec =================================================================== RCS file: /kolabrepository/server/php-kolab/Kolab_Server/Kolab_Server.spec,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- Kolab_Server.spec 24 Feb 2009 11:57:46 -0000 1.9 +++ Kolab_Server.spec 13 Oct 2009 12:37:28 -0000 1.9.2.1 @@ -1,7 +1,8 @@ # Variables %define V_package Kolab_Server %define V_version 0.4.0 -%define V_release 20090224 +%define V_release 20091013 +%define V_sourceurl http://pear.horde.org/get # Package Information Name: %{V_package} @@ -15,7 +16,10 @@ Distribution: OpenPKG # List of Sources -Source: http://pear.horde.org/get/%{V_package}-%{V_version}.tgz +Source: %{V_sourceurl}/%{V_package}-%{V_version}.tgz + +# List of patches +Patch0: mapping.patch # Build Info Prefix: %{l_prefix} @@ -28,6 +32,7 @@ PreReq: OpenPKG, openpkg >= 20070603 PreReq: php, php::with_pear = yes PreReq: Horde_LDAP +PreReq: PEAR-Net_LDAP2 PreReq: PHPUnit %description @@ -37,12 +42,16 @@ %prep %setup -n %{V_package}-%{V_version} + %patch -p3 -P 0 + + cat ../package.xml | sed -e 's/md5sum="[^"]*"//' > package.xml + %build %install env PHP_PEAR_PHP_BIN="%{l_prefix}/bin/php -d safe_mode=off -d memory_limit=40M" \ PHP_PEAR_CACHE_DIR="/tmp/pear/cache" \ - %{l_prefix}/bin/pear install --offline --force --nodeps -P $RPM_BUILD_ROOT $RPM_SOURCE_DIR/%{V_package}-%{V_version}.tgz + %{l_prefix}/bin/pear install --offline --force --nodeps -P $RPM_BUILD_ROOT package.xml rm -rf $RPM_BUILD_ROOT/%{l_prefix}/lib/php/{.filemap,.lock,.channels,.depdb,.depdblock} %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} From cvs at kolab.org Tue Oct 13 14:57:58 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 14:57:58 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.12, 1.32.2.13 Message-ID: <20091013125758.58139600174@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv13852 Modified Files: Tag: kolab_2_2_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.12 retrieving revision 1.32.2.13 diff -u -d -r1.32.2.12 -r1.32.2.13 --- horde-webmail-1.2.0_kolab_openpkg.patch 12 Oct 2009 14:09:00 -0000 1.32.2.12 +++ horde-webmail-1.2.0_kolab_openpkg.patch 13 Oct 2009 12:57:55 -0000 1.32.2.13 @@ -20001,6 +20001,6033 @@ LINK: https://www.intevation.de/roundup/kolab/issue3525 LINK: https://www.intevation.de/roundup/kolab/issue3528 From: Gunnar Wrobel

+Subject: [PATCH] t/pear/HK/GW/AddNetLDAP2 + +Adds the PEAR-Net_LDAP2 library. + +Signed-off-by: Gunnar Wrobel

+ +--- + horde-webmail/pear/Net/LDAP2.php | 1698 ++++++++++++++++++++++++++++++ [...6002 lines suppressed...] ++ } ++} ++ ++?> +\ No newline at end of file +-- +tg: (031aea6..) t/pear/HK/GW/AddNetLDAP2 (depends on: t/dimp/H/GW/AclView) +-- +TOPGIT patch commit log +======================= + +commit 0ad87da8cf55073240d541edea74e6a60bbe3695 +Author: Gunnar Wrobel

+Date: Thu Apr 23 13:41:35 2009 +0200 + + Add PEAR-Net_LDAP2 +From: Gunnar Wrobel

Subject: [PATCH] t/framework/HK/GW/Prefs/FileDriverHotfix.diff A hotfix for https://issues.kolab.org/issue3555 From cvs at kolab.org Tue Oct 13 15:24:09 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 15:24:09 +0200 (CEST) Subject: wilde: server/kolabd/kolabd/templates freebusy.conf.template.in, 1.21, 1.21.2.1 resmgr.conf.template.in, 1.34, 1.34.2.1 Message-ID: <20091013132409.54A21600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolabd/kolabd/templates In directory doto:/tmp/cvs-serv14888/kolabd/kolabd/templates Modified Files: Tag: kolab_2_2_branch freebusy.conf.template.in resmgr.conf.template.in Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) Index: freebusy.conf.template.in =================================================================== RCS file: /kolabrepository/server/kolabd/kolabd/templates/freebusy.conf.template.in,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -u -d -r1.21 -r1.21.2.1 --- freebusy.conf.template.in 10 Feb 2009 22:41:14 -0000 1.21 +++ freebusy.conf.template.in 13 Oct 2009 13:24:07 -0000 1.21.2.1 @@ -58,6 +58,24 @@ $conf['kolab']['ldap']['phpdn'] = '@@@php_dn@@@'; $conf['kolab']['ldap']['phppw'] = '@@@php_pw@@@'; +/** + * If you use customized LDAP attributes on your LDAP server the + * following configuration setting allows you to map the standard + * Kolab attribute names to your customizations. + * + * Specify the mapping line by line: + * + * $conf['kolab']['ldap']['map']['uid'] = 'uid2'; + * $conf['kolab']['ldap']['map']['mobile'] = 'handy'; + * + * or use a hash structure: + * + * $conf['kolab']['ldap']['map'] = array('uid' => 'uid2', + * 'mobile' => 'handy'); + * + */ +//$conf['kolab']['ldap']['map']['uid'] = 'uid2'; + /* Horde::Kolab::IMAP configuration */ $conf['kolab']['imap']['server'] = '@@@fqdnhostname@@@'; $conf['kolab']['imap']['port'] = 143; Index: resmgr.conf.template.in =================================================================== RCS file: /kolabrepository/server/kolabd/kolabd/templates/resmgr.conf.template.in,v retrieving revision 1.34 retrieving revision 1.34.2.1 diff -u -d -r1.34 -r1.34.2.1 --- resmgr.conf.template.in 10 Feb 2009 22:41:14 -0000 1.34 +++ resmgr.conf.template.in 13 Oct 2009 13:24:07 -0000 1.34.2.1 @@ -138,6 +138,24 @@ /* What password should we use with the above DN when binding? */ $conf['kolab']['ldap']['phppw'] = '@@@php_pw@@@'; +/** + * If you use customized LDAP attributes on your LDAP server the + * following configuration setting allows you to map the standard + * Kolab attribute names to your customizations. + * + * Specify the mapping line by line: + * + * $conf['kolab']['ldap']['map']['uid'] = 'uid2'; + * $conf['kolab']['ldap']['map']['mobile'] = 'handy'; + * + * or use a hash structure: + * + * $conf['kolab']['ldap']['map'] = array('uid' => 'uid2', + * 'mobile' => 'handy'); + * + */ +//$conf['kolab']['ldap']['map']['uid'] = 'uid2'; + /* What account should we use to read/write calendar data? This * account should have access to the calendar mailbox of all * resource/group mailboxes. From cvs at kolab.org Tue Oct 13 15:24:10 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 15:24:10 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/tg t_Kolab__Server_HK_GW_MappableAttributes.diff, NONE, 1.1.4.1 series, 1.5.2.7, 1.5.2.8 Message-ID: <20091013132410.98FE9600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv14888/patches/horde-webmail/1.2.0/tg Modified Files: Tag: kolab_2_2_branch series Added Files: Tag: kolab_2_2_branch t_Kolab__Server_HK_GW_MappableAttributes.diff Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) --- NEW FILE: t_Kolab__Server_HK_GW_MappableAttributes.diff --- From: Gunnar Wrobel

Subject: [PATCH] t/Kolab_Server/HK/GW/MappableAttributes Allow to configure mapped LDAP attributes. Signed-off-by: Gunnar Wrobel

--- horde-webmail/lib/Horde/Kolab/Server.php | 15 +- horde-webmail/lib/Horde/Kolab/Server/Object.php | 2 + .../lib/Horde/Kolab/Server/Object/address.php | 33 ++- .../lib/Horde/Kolab/Server/Object/adminrole.php | 35 ++- .../lib/Horde/Kolab/Server/Object/distlist.php | 30 ++- .../lib/Horde/Kolab/Server/Object/group.php | 23 +- .../lib/Horde/Kolab/Server/Object/server.php | 21 ++- .../lib/Horde/Kolab/Server/Object/sharedfolder.php | 23 +- .../lib/Horde/Kolab/Server/Object/user.php | 32 ++- horde-webmail/lib/Horde/Kolab/Server/ldap.php | 308 ++++++++++++++++++-- horde-webmail/lib/Horde/Kolab/Server/test.php | 20 ++- 11 files changed, 467 insertions(+), 75 deletions(-) diff --git a/horde-webmail/lib/Horde/Kolab/Server.php b/horde-webmail/lib/Horde/Kolab/Server.php index bf251f5..fd0bda7 100644 --- a/horde-webmail/lib/Horde/Kolab/Server.php +++ b/horde-webmail/lib/Horde/Kolab/Server.php @@ -159,9 +159,12 @@ class Horde_Kolab_Server { $driver = 'ldap'; $server_params = array('server' => $conf['kolab']['ldap']['server'], - 'base_dn' => $conf['kolab']['ldap']['basedn'], - 'uid' => $conf['kolab']['ldap']['phpdn'], - 'pass' => $conf['kolab']['ldap']['phppw']); + 'base_dn' => $conf['kolab']['ldap']['basedn'], + 'uid' => $conf['kolab']['ldap']['phpdn'], + 'pass' => $conf['kolab']['ldap']['phppw']); + if (isset($conf['kolab']['ldap']['map'])) { + $server_params['map'] = $conf['kolab']['ldap']['map']; + } } else { $driver = null; $server_params = array(); @@ -473,7 +476,7 @@ class Horde_Kolab_Server { function uidForId($id, $restrict = KOLAB_SERVER_RESULT_SINGLE) { - return $this->uidForAttr('uid', $id); + return $this->uidForAttr(KOLAB_ATTR_SID, $id); } /** @@ -513,7 +516,7 @@ class Horde_Kolab_Server { */ function uidForIdOrMail($id) { - $uid = $this->uidForAttr('uid', $id); + $uid = $this->uidForAttr(KOLAB_ATTR_SID, $id); if (!$uid) { $uid = $this->uidForAttr('mail', $id); } @@ -562,7 +565,7 @@ class Horde_Kolab_Server { */ function uidForMailOrIdOrAlias($id) { - $uid = $this->uidForAttr('uid', $id); + $uid = $this->uidForAttr(KOLAB_ATTR_SID, $id); if (!$uid) { $uid = $this->uidForAttr('mail', $id); if (!$uid) { diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object.php b/horde-webmail/lib/Horde/Kolab/Server/Object.php index 2e5ada2..be9eca9 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object.php @@ -26,6 +26,7 @@ define('KOLAB_OBJECT_USER', 'Horde_Kolab_Server_Object_user'); define('KOLAB_OBJECT_SERVER', 'Horde_Kolab_Server_Object_server'); /** Define the possible Kolab object attributes */ +define('KOLAB_ATTR_OC', 'objectClass'); define('KOLAB_ATTR_UID', 'dn'); define('KOLAB_ATTR_ID', 'id'); define('KOLAB_ATTR_SN', 'sn'); @@ -35,6 +36,7 @@ define('KOLAB_ATTR_FN', 'fn'); define('KOLAB_ATTR_LNFN', 'lnfn'); define('KOLAB_ATTR_FNLN', 'fnln'); define('KOLAB_ATTR_MAIL', 'mail'); +define('KOLAB_ATTR_ALIAS', 'alias'); define('KOLAB_ATTR_SID', 'uid'); define('KOLAB_ATTR_ACL', 'acl'); define('KOLAB_ATTR_MEMBER', 'member'); diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/address.php b/horde-webmail/lib/Horde/Kolab/Server/Object/address.php index 98ed518..bd6128f 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/address.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/address.php @@ -33,13 +33,6 @@ class Horde_Kolab_Server_Object_address extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(objectclass=inetOrgPerson)(!(uid=*))(sn=*))'; - - /** * The attributes supported by this class * * @var array @@ -86,6 +79,32 @@ class Horde_Kolab_Server_Object_address extends Horde_Kolab_Server_Object { ); /** + * The LDAP filter to retrieve this object type + * + * @return string + */ + function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_SN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_INETORGPERSON), + array('NOT' => array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => '*'), + ), + ), + ), + ); + return $criteria; + } + + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php b/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php index aea4410..b2571ff 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php @@ -32,13 +32,6 @@ class Horde_Kolab_Server_Object_adminrole extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(cn=*)(objectClass=inetOrgPerson)(!(uid=manager))(sn=*))'; - - /** * The attributes supported by this class * * @var array @@ -87,6 +80,34 @@ class Horde_Kolab_Server_Object_adminrole extends Horde_Kolab_Server_Object { ); /** + * The LDAP filter to retrieve this object type + * + * @return string + */ + function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_CN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_SN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_INETORGPERSON), + array('NOT' => array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => 'manager'), + ), + ), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php b/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php index 7965e0d..22e096e 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php @@ -34,14 +34,6 @@ require_once 'Horde/Kolab/Server/Object/group.php'; class Horde_Kolab_Server_Object_distlist extends Horde_Kolab_Server_Object_group { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(objectClass=kolabGroupOfNames)(mail=*))'; - - - /** * The attributes required when creating an object of this class. * * @var array @@ -49,4 +41,26 @@ class Horde_Kolab_Server_Object_distlist extends Horde_Kolab_Server_Object_group var $_required_attributes = array( KOLAB_ATTR_MAIL, ); + + /** + * Return the filter string to retrieve this object type. + * + * @static + * + * @return string The filter to retrieve this object type from the server + * database. + */ + public static function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABGROUPOFNAMES), + ), + ); + return $criteria; + } }; diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/group.php b/horde-webmail/lib/Horde/Kolab/Server/Object/group.php index 91c1bd2..f58c905 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/group.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/group.php @@ -32,13 +32,6 @@ class Horde_Kolab_Server_Object_group extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(objectClass=kolabGroupOfNames)'; - - /** * The attributes supported by this class * * @var array @@ -104,6 +97,22 @@ class Horde_Kolab_Server_Object_group extends Horde_Kolab_Server_Object { } /** + * Return the filter string to retrieve this object type. + * + * @return string The filter to retrieve this object type from the server + * database. + */ + public static function getFilter() + { + $criteria = array('AND' => array(array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABGROUPOFNAMES), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/server.php b/horde-webmail/lib/Horde/Kolab/Server/Object/server.php index 965eb84..740417c 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/server.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/server.php @@ -32,11 +32,26 @@ class Horde_Kolab_Server_Object_server extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type + * Return the filter string to retrieve this object type. * - * @var string + * @static + * + * @return string The filter to retrieve this object type from the server + * database. */ - var $filter = '(&((k=kolab))(objectclass=kolab))'; + public static function getFilter() + { + $criteria = array('AND' => array( + array('field' => 'k', + 'op' => '=', + 'test' => 'kolab'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLAB), + ), + ); + return $criteria; + } /** * The attributes supported by this class diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php b/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php index 3b68862..b92f07b 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php @@ -33,13 +33,6 @@ class Horde_Kolab_Server_Object_sharedfolder extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(objectClass=kolabSharedFolder)'; - - /** * The attributes supported by this class * * @var array @@ -89,6 +82,22 @@ class Horde_Kolab_Server_Object_sharedfolder extends Horde_Kolab_Server_Object { } /** + * Return the filter string to retrieve this object type. + * + * @return string The filter to retrieve this object type from the server + * database. + */ + public static function getFilter() + { + $criteria = array('AND' => array(array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABSHAREDFOLDER), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/user.php b/horde-webmail/lib/Horde/Kolab/Server/Object/user.php index d4e57a0..b702a4f 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/Object/user.php +++ b/horde-webmail/lib/Horde/Kolab/Server/Object/user.php @@ -33,13 +33,6 @@ class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object { /** - * The LDAP filter to retrieve this object type - * - * @var string - */ - var $filter = '(&(objectClass=kolabInetOrgPerson)(uid=*)(mail=*)(sn=*))'; - - /** * The attributes supported by this class * * @var array @@ -154,6 +147,31 @@ class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object { } /** + * The LDAP filter to retrieve this object type + * + * @return string + */ + function getFilter() + { + $criteria = array('AND' => array( + array('field' => KOLAB_ATTR_SN, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => '*'), + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + ), + ); + return $criteria; + } + + /** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. diff --git a/horde-webmail/lib/Horde/Kolab/Server/ldap.php b/horde-webmail/lib/Horde/Kolab/Server/ldap.php index a50ba2c..ea73b4f 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/ldap.php +++ b/horde-webmail/lib/Horde/Kolab/Server/ldap.php @@ -2,7 +2,7 @@ /** * The driver for accessing the Kolab user database stored in LDAP. * - * $Horde: framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php,v 1.2.2.2 2008/08/01 07:56:19 wrobel Exp $ + * $Horde: framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php,v 1.2.2.10 2009/02/24 07:39:47 wrobel Exp $ * * PHP version 4 * @@ -210,6 +210,7 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } if (isset($attrs)) { + $this->mapKeys($attrs); $result = @ldap_read($this->_connection, $dn, '(objectclass=*)', $attrs); } else { $result = @ldap_read($this->_connection, $dn, '(objectclass=*)'); @@ -220,7 +221,7 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } $entry = $this->_firstEntry($result); if (!$entry) { - ldap_free_result($result); + @ldap_free_result($result); return PEAR::raiseError(sprintf(_("LDAP Error: Empty result for: %s."), $dn)); } @@ -229,7 +230,10 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { return PEAR::raiseError(sprintf(_("LDAP Error: No such dn: %s: %s"), $dn, $this->_error())); } - ldap_free_result($result); + @ldap_free_result($result); + + $this->unmapAttributes($object); + return $object; } @@ -250,6 +254,8 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } } + $this->mapAttributes($data); + return @ldap_add($this->_connection, $dn, $data); } @@ -681,9 +687,25 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function mailForIdOrMail($id) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. - Horde_LDAP::quote($id) . ')(mail=' . - Horde_LDAP::quote($id) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $id), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $id), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); + $result = $this->_attrsForFilter($filter, array('mail'), KOLAB_SERVER_RESULT_STRICT); if (is_a($result, 'PEAR_Error')) { @@ -702,9 +724,24 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function uidForIdOrMail($id) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. - Horde_LDAP::quote($id) . ')(mail=' . - Horde_LDAP::quote($id) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $id), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $id), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter, KOLAB_SERVER_RESULT_STRICT); } @@ -717,9 +754,25 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function addrsForIdOrMail($id) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(mail=' - . Horde_LDAP::quote($id) . ')(uid=' - . Horde_LDAP::quote($id) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $id), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $id), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); + $result = $this->_attrsForFilter($filter, array('mail', 'alias'), KOLAB_SERVER_RESULT_STRICT); if (empty($result)) { @@ -768,10 +821,27 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { */ function uidForMailAddress($mail) { - $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. - Horde_LDAP::quote($mail) . ')(mail=' . - Horde_LDAP::quote($mail) . ')(alias=' . - Horde_LDAP::quote($mail) . ')))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('OR' => + array( + array('field' => KOLAB_ATTR_ALIAS, + 'op' => '=', + 'test' => $mail), + array('field' => KOLAB_ATTR_MAIL, + 'op' => '=', + 'test' => $mail), + array('field' => KOLAB_ATTR_SID, + 'op' => '=', + 'test' => $mail), + ), + ), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter); } @@ -788,8 +858,17 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { function uidForAttr($attr, $value, $restrict = KOLAB_SERVER_RESULT_SINGLE) { - $filter = '(&(objectClass=kolabInetOrgPerson)(' . $attr . - '=' . Horde_LDAP::quote($value) . '))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABINETORGPERSON), + array('field' => $attr, + 'op' => '=', + 'test' => $value), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter, $restrict); } @@ -806,8 +885,17 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { function gidForAttr($attr, $value, $restrict = KOLAB_SERVER_RESULT_SINGLE) { - $filter = '(&(objectClass=kolabGroupOfNames)(' . $attr . - '=' . Horde_LDAP::quote($value) . '))'; + $criteria = array('AND' => + array( + array('field' => KOLAB_ATTR_OC, + 'op' => '=', + 'test' => KOLAB_OC_KOLABGROUPOFNAMES), + array('field' => $attr, + 'op' => '=', + 'test' => $value), + ), + ); + $filter = $this->searchQuery($criteria); return $this->_dnForFilter($filter, $restrict); } @@ -874,7 +962,13 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { return $result; } $vars = get_class_vars($type); - $filter = $vars['filter']; + $methods = get_class_methods($type); + if (!in_array('getFilter', $methods)) { + $filter = $vars['filter']; + } else { + $criteria = call_user_func(array($type, 'getFilter')); + $filter = $this->searchQuery($criteria); + } $sort = $vars['sort_by']; if (isset($params['sort'])) { @@ -993,4 +1087,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { } } + /** + * Build a search query. + * + * Taken from the Turba LDAP driver. + * + * @param array $criteria The array of criteria. + * + * @return string An LDAP query filter. + */ + public function searchQuery($criteria) + { + require_once 'Net/LDAP2.php'; + + /* Accept everything. */ + $filter = '(' . strtolower(KOLAB_ATTR_OC) . '=*)'; + + /* Build the LDAP filter. */ + if (count($criteria)) { + $f = $this->buildSearchQuery($criteria); + if (is_a($f, 'Net_LDAP2_Filter')) { + $filter = $f->asString(); + } + } + return $filter; + } + + /** + * Build a piece of a search query. + * + * Taken from the Turba LDAP driver. + * + * @param array $criteria The array of criteria. + * + * @return string An LDAP query fragment. + */ + protected function &buildSearchQuery($criteria) + { + if (isset($criteria['field'])) { + require_once 'Horde/String.php'; + require_once 'Horde/NLS.php'; + $rhs = $criteria['test']; + /* Keep this in for reference as we did not really test servers with different encoding yet */ + //$rhs = String::convertCharset($criteria['test'], NLS::getCharset(), $this->params['charset']); + switch ($criteria['op']) { + case '=': + $op = 'equals'; + break; + } + return Net_LDAP2_Filter::create($this->mapField($criteria['field']), + $op, $rhs); + } + foreach ($criteria as $key => $vals) { + if (!empty($vals['OR']) + || !empty($vals['AND']) + || !empty($vals['NOT'])) { + $parts = $this->buildSearchQuery($vals); + if (count($parts) > 1) { + if (!empty($vals['OR'])) { + $operator = '|'; + } else if (!empty($vals['NOT'])) { + $operator = '!'; + } else { + $operator = '&'; + } + return Net_LDAP2_Filter::combine($operator, $parts); + } else { + return $parts[0]; + } + } else { + $parts = array(); + foreach ($vals as $test) { + $parts[] = &$this->buildSearchQuery($test); + } + switch ($key) { + case 'OR': + $operator = '|'; + break; + case 'AND': + $operator = '&'; + break; + case 'NOT': + $operator = '!'; + break; + } + if (count($parts) > 1) { + return Net_LDAP2_Filter::combine($operator, $parts); + } else if ($operator == '!') { + return Net_LDAP2_Filter::combine($operator, $parts[0]); + } else { + return $parts[0]; + } + } + } + } + + /** + * Map attributes defined within this library their their real world + * counterparts. + * + * @param array $data The data that has been read and needs to be mapped. + * + * @return NULL + */ + protected function unmapAttributes(&$data) + { + if (!empty($this->_params['map'])) { + foreach ($this->_params['map'] as $attribute => $map) { + if (isset($data[$map])) { + $data[$attribute] = $data[$map]; + unset($data[$map]); + } + } + } + } + + /** + * Map attributes defined within this library into their real world + * counterparts. + * + * @param array $data The data to be written. + * + * @return NULL + */ + protected function mapAttributes(&$data) + { + if (!empty($this->_params['map'])) { + foreach ($this->_params['map'] as $attribute => $map) { + if (isset($data[$attribute])) { + $data[$map] = $data[$attribute]; + unset($data[$attribute]); + } + } + } + } + + /** + * Map attribute keys defined within this library into their real world + * counterparts. + * + * @param array $keys The attribute keys. + * + * @return NULL + */ + protected function mapKeys(&$keys) + { + if (!empty($this->_params['map'])) { + foreach ($this->_params['map'] as $attribute => $map) { + $key = array_search($attribute, $keys); + if ($key !== false) { + $keys[$key] = $map; + } + } + } + } + + /** + * Map a single attribute key defined within this library into its real + * world counterpart. + * + * @param array $field The attribute name. + * + * @return The real name of this attribute on the server we connect to. + */ + protected function mapField($field) + { + if (!empty($this->_params['map']) + && isset($this->_params['map'][$field])) { + return $this->_params['map'][$field]; + } + return $field; + } + } diff --git a/horde-webmail/lib/Horde/Kolab/Server/test.php b/horde-webmail/lib/Horde/Kolab/Server/test.php index 47f985a..fc19c80 100644 --- a/horde-webmail/lib/Horde/Kolab/Server/test.php +++ b/horde-webmail/lib/Horde/Kolab/Server/test.php @@ -247,6 +247,10 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { } } + if (!empty($attributes)) { + $this->mapKeys($attributes); + } + $filter = $this->_parse($filter); if (is_a($filter, 'PEAR_Error')) { return $filter; @@ -265,6 +269,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { $result = $subtree; } + $this->unmapAttributes($result); + return $result; } @@ -286,7 +292,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { switch ($filter['log']) { case '=': $value = $element['data'][$filter['att']]; - if (($filter['val'] == '*' && !empty($value)) + if ((($filter['val'] == '*' || $filter['val'] == '\2a') + && !empty($value)) || $value == $filter['val'] || (is_array($value) && in_array($filter['val'], $value))) { @@ -390,8 +397,12 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { $dn)); } if (empty($attrs)) { - return $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; + $data = $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; + $this->unmapAttributes($data); + return $data; } else { + $this->mapKeys($attrs); + $result = array(); $data = $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; @@ -401,6 +412,9 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { array_push($result, $attr); } } + + $this->unmapAttributes($result); + $result['count'] = 1; return $result; } @@ -423,6 +437,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { } } + $this->mapAttributes($data); + $ldap_data = array(); foreach ($data as $key => $val) { if (!is_array($val)) { -- tg: (0ad87da..) t/Kolab_Server/HK/GW/MappableAttributes (depends on: t/pear/HK/GW/AddNetLDAP2) -- TOPGIT patch commit log ======================= commit 296112ac1021e0433ca9578a700c8f066bc139a9 Author: Gunnar Wrobel

Date: Fri Apr 24 19:30:10 2009 +0200 Fixed mapping of attributes. Fixed uidForAttr and gidForAttr. commit a2525f3bf8a77431e4cd28bd92e1cb9fec14e392 Author: Gunnar Wrobel

Date: Thu Apr 23 13:45:14 2009 +0200 Allow to configurable LDAP attribute mapping. Index: series =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/series,v retrieving revision 1.5.2.7 retrieving revision 1.5.2.8 diff -u -d -r1.5.2.7 -r1.5.2.8 --- series 13 Oct 2009 12:37:27 -0000 1.5.2.7 +++ series 13 Oct 2009 13:24:08 -0000 1.5.2.8 @@ -69,6 +69,7 @@ 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_framework_HK_GW_Prefs_FileDriverHotfix.diff -p1 t_kronolith_HK_GW_AnonymousiCalDownload.diff -p1 t_kronolith_HK_GW_ExportEventList.diff -p1 From cvs at kolab.org Tue Oct 13 15:24:11 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 15:24:11 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.13, 1.32.2.14 Message-ID: <20091013132411.12A79600801@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv14888/patches/horde-webmail/1.2.0 Modified Files: Tag: kolab_2_2_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Added ability to map arbitrary ldap attributes to those expected by kolab. (Merged from suc branch) Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.13 retrieving revision 1.32.2.14 diff -u -d -r1.32.2.13 -r1.32.2.14 --- horde-webmail-1.2.0_kolab_openpkg.patch 13 Oct 2009 12:57:55 -0000 1.32.2.13 +++ horde-webmail-1.2.0_kolab_openpkg.patch 13 Oct 2009 13:24:07 -0000 1.32.2.14 @@ -26028,6 +26028,895 @@ Add PEAR-Net_LDAP2 From: Gunnar Wrobel

+Subject: [PATCH] t/Kolab_Server/HK/GW/MappableAttributes + +Allow to configure mapped LDAP attributes. + +Signed-off-by: Gunnar Wrobel

+ +--- + horde-webmail/lib/Horde/Kolab/Server.php | 15 +- + horde-webmail/lib/Horde/Kolab/Server/Object.php | 2 + + .../lib/Horde/Kolab/Server/Object/address.php | 33 ++- + .../lib/Horde/Kolab/Server/Object/adminrole.php | 35 ++- + .../lib/Horde/Kolab/Server/Object/distlist.php | 30 ++- + .../lib/Horde/Kolab/Server/Object/group.php | 23 +- + .../lib/Horde/Kolab/Server/Object/server.php | 21 ++- + .../lib/Horde/Kolab/Server/Object/sharedfolder.php | 23 +- + .../lib/Horde/Kolab/Server/Object/user.php | 32 ++- + horde-webmail/lib/Horde/Kolab/Server/ldap.php | 308 ++++++++++++++++++-- + horde-webmail/lib/Horde/Kolab/Server/test.php | 20 ++- + 11 files changed, 467 insertions(+), 75 deletions(-) + +diff --git a/horde-webmail/lib/Horde/Kolab/Server.php b/horde-webmail/lib/Horde/Kolab/Server.php +index bf251f5..fd0bda7 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server.php ++++ b/horde-webmail/lib/Horde/Kolab/Server.php +@@ -159,9 +159,12 @@ class Horde_Kolab_Server { + $driver = 'ldap'; + + $server_params = array('server' => $conf['kolab']['ldap']['server'], +- 'base_dn' => $conf['kolab']['ldap']['basedn'], +- 'uid' => $conf['kolab']['ldap']['phpdn'], +- 'pass' => $conf['kolab']['ldap']['phppw']); ++ 'base_dn' => $conf['kolab']['ldap']['basedn'], ++ 'uid' => $conf['kolab']['ldap']['phpdn'], ++ 'pass' => $conf['kolab']['ldap']['phppw']); ++ if (isset($conf['kolab']['ldap']['map'])) { ++ $server_params['map'] = $conf['kolab']['ldap']['map']; ++ } + } else { + $driver = null; + $server_params = array(); +@@ -473,7 +476,7 @@ class Horde_Kolab_Server { + function uidForId($id, + $restrict = KOLAB_SERVER_RESULT_SINGLE) + { +- return $this->uidForAttr('uid', $id); ++ return $this->uidForAttr(KOLAB_ATTR_SID, $id); + } + + /** +@@ -513,7 +516,7 @@ class Horde_Kolab_Server { + */ + function uidForIdOrMail($id) + { +- $uid = $this->uidForAttr('uid', $id); ++ $uid = $this->uidForAttr(KOLAB_ATTR_SID, $id); + if (!$uid) { + $uid = $this->uidForAttr('mail', $id); + } +@@ -562,7 +565,7 @@ class Horde_Kolab_Server { + */ + function uidForMailOrIdOrAlias($id) + { +- $uid = $this->uidForAttr('uid', $id); ++ $uid = $this->uidForAttr(KOLAB_ATTR_SID, $id); + if (!$uid) { + $uid = $this->uidForAttr('mail', $id); + if (!$uid) { +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object.php b/horde-webmail/lib/Horde/Kolab/Server/Object.php +index 2e5ada2..be9eca9 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object.php +@@ -26,6 +26,7 @@ define('KOLAB_OBJECT_USER', 'Horde_Kolab_Server_Object_user'); + define('KOLAB_OBJECT_SERVER', 'Horde_Kolab_Server_Object_server'); + + /** Define the possible Kolab object attributes */ ++define('KOLAB_ATTR_OC', 'objectClass'); + define('KOLAB_ATTR_UID', 'dn'); + define('KOLAB_ATTR_ID', 'id'); + define('KOLAB_ATTR_SN', 'sn'); +@@ -35,6 +36,7 @@ define('KOLAB_ATTR_FN', 'fn'); + define('KOLAB_ATTR_LNFN', 'lnfn'); + define('KOLAB_ATTR_FNLN', 'fnln'); + define('KOLAB_ATTR_MAIL', 'mail'); ++define('KOLAB_ATTR_ALIAS', 'alias'); + define('KOLAB_ATTR_SID', 'uid'); + define('KOLAB_ATTR_ACL', 'acl'); + define('KOLAB_ATTR_MEMBER', 'member'); +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/address.php b/horde-webmail/lib/Horde/Kolab/Server/Object/address.php +index 98ed518..bd6128f 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/address.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/address.php +@@ -33,13 +33,6 @@ + class Horde_Kolab_Server_Object_address extends Horde_Kolab_Server_Object { + + /** +- * The LDAP filter to retrieve this object type +- * +- * @var string +- */ +- var $filter = '(&(objectclass=inetOrgPerson)(!(uid=*))(sn=*))'; +- +- /** + * The attributes supported by this class + * + * @var array +@@ -86,6 +79,32 @@ class Horde_Kolab_Server_Object_address extends Horde_Kolab_Server_Object { + ); + + /** ++ * The LDAP filter to retrieve this object type ++ * ++ * @return string ++ */ ++ function getFilter() ++ { ++ $criteria = array('AND' => array( ++ array('field' => KOLAB_ATTR_SN, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_INETORGPERSON), ++ array('NOT' => array( ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => '*'), ++ ), ++ ), ++ ), ++ ); ++ return $criteria; ++ } ++ ++ ++ /** + * Convert the object attributes to a hash. + * + * @param string $attrs The attributes to return. +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php b/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php +index aea4410..b2571ff 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/adminrole.php +@@ -32,13 +32,6 @@ + class Horde_Kolab_Server_Object_adminrole extends Horde_Kolab_Server_Object { + + /** +- * The LDAP filter to retrieve this object type +- * +- * @var string +- */ +- var $filter = '(&(cn=*)(objectClass=inetOrgPerson)(!(uid=manager))(sn=*))'; +- +- /** + * The attributes supported by this class + * + * @var array +@@ -87,6 +80,34 @@ class Horde_Kolab_Server_Object_adminrole extends Horde_Kolab_Server_Object { + ); + + /** ++ * The LDAP filter to retrieve this object type ++ * ++ * @return string ++ */ ++ function getFilter() ++ { ++ $criteria = array('AND' => array( ++ array('field' => KOLAB_ATTR_CN, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_SN, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_INETORGPERSON), ++ array('NOT' => array( ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => 'manager'), ++ ), ++ ), ++ ), ++ ); ++ return $criteria; ++ } ++ ++ /** + * Convert the object attributes to a hash. + * + * @param string $attrs The attributes to return. +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php b/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php +index 7965e0d..22e096e 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/distlist.php +@@ -34,14 +34,6 @@ require_once 'Horde/Kolab/Server/Object/group.php'; + class Horde_Kolab_Server_Object_distlist extends Horde_Kolab_Server_Object_group { + + /** +- * The LDAP filter to retrieve this object type +- * +- * @var string +- */ +- var $filter = '(&(objectClass=kolabGroupOfNames)(mail=*))'; +- +- +- /** + * The attributes required when creating an object of this class. + * + * @var array +@@ -49,4 +41,26 @@ class Horde_Kolab_Server_Object_distlist extends Horde_Kolab_Server_Object_group + var $_required_attributes = array( + KOLAB_ATTR_MAIL, + ); ++ ++ /** ++ * Return the filter string to retrieve this object type. ++ * ++ * @static ++ * ++ * @return string The filter to retrieve this object type from the server ++ * database. ++ */ ++ public static function getFilter() ++ { ++ $criteria = array('AND' => array( ++ array('field' => KOLAB_ATTR_MAIL, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABGROUPOFNAMES), ++ ), ++ ); ++ return $criteria; ++ } + }; +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/group.php b/horde-webmail/lib/Horde/Kolab/Server/Object/group.php +index 91c1bd2..f58c905 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/group.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/group.php +@@ -32,13 +32,6 @@ + class Horde_Kolab_Server_Object_group extends Horde_Kolab_Server_Object { + + /** +- * The LDAP filter to retrieve this object type +- * +- * @var string +- */ +- var $filter = '(objectClass=kolabGroupOfNames)'; +- +- /** + * The attributes supported by this class + * + * @var array +@@ -104,6 +97,22 @@ class Horde_Kolab_Server_Object_group extends Horde_Kolab_Server_Object { + } + + /** ++ * Return the filter string to retrieve this object type. ++ * ++ * @return string The filter to retrieve this object type from the server ++ * database. ++ */ ++ public static function getFilter() ++ { ++ $criteria = array('AND' => array(array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABGROUPOFNAMES), ++ ), ++ ); ++ return $criteria; ++ } ++ ++ /** + * Convert the object attributes to a hash. + * + * @param string $attrs The attributes to return. +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/server.php b/horde-webmail/lib/Horde/Kolab/Server/Object/server.php +index 965eb84..740417c 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/server.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/server.php +@@ -32,11 +32,26 @@ + class Horde_Kolab_Server_Object_server extends Horde_Kolab_Server_Object { + + /** +- * The LDAP filter to retrieve this object type ++ * Return the filter string to retrieve this object type. + * +- * @var string ++ * @static ++ * ++ * @return string The filter to retrieve this object type from the server ++ * database. + */ +- var $filter = '(&((k=kolab))(objectclass=kolab))'; ++ public static function getFilter() ++ { ++ $criteria = array('AND' => array( ++ array('field' => 'k', ++ 'op' => '=', ++ 'test' => 'kolab'), ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLAB), ++ ), ++ ); ++ return $criteria; ++ } + + /** + * The attributes supported by this class +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php b/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php +index 3b68862..b92f07b 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/sharedfolder.php +@@ -33,13 +33,6 @@ + class Horde_Kolab_Server_Object_sharedfolder extends Horde_Kolab_Server_Object { + + /** +- * The LDAP filter to retrieve this object type +- * +- * @var string +- */ +- var $filter = '(objectClass=kolabSharedFolder)'; +- +- /** + * The attributes supported by this class + * + * @var array +@@ -89,6 +82,22 @@ class Horde_Kolab_Server_Object_sharedfolder extends Horde_Kolab_Server_Object { + } + + /** ++ * Return the filter string to retrieve this object type. ++ * ++ * @return string The filter to retrieve this object type from the server ++ * database. ++ */ ++ public static function getFilter() ++ { ++ $criteria = array('AND' => array(array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABSHAREDFOLDER), ++ ), ++ ); ++ return $criteria; ++ } ++ ++ /** + * Convert the object attributes to a hash. + * + * @param string $attrs The attributes to return. +diff --git a/horde-webmail/lib/Horde/Kolab/Server/Object/user.php b/horde-webmail/lib/Horde/Kolab/Server/Object/user.php +index d4e57a0..b702a4f 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/Object/user.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/Object/user.php +@@ -33,13 +33,6 @@ + class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object { + + /** +- * The LDAP filter to retrieve this object type +- * +- * @var string +- */ +- var $filter = '(&(objectClass=kolabInetOrgPerson)(uid=*)(mail=*)(sn=*))'; +- +- /** + * The attributes supported by this class + * + * @var array +@@ -154,6 +147,31 @@ class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object { + } + + /** ++ * The LDAP filter to retrieve this object type ++ * ++ * @return string ++ */ ++ function getFilter() ++ { ++ $criteria = array('AND' => array( ++ array('field' => KOLAB_ATTR_SN, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_MAIL, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => '*'), ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABINETORGPERSON), ++ ), ++ ); ++ return $criteria; ++ } ++ ++ /** + * Convert the object attributes to a hash. + * + * @param string $attrs The attributes to return. +diff --git a/horde-webmail/lib/Horde/Kolab/Server/ldap.php b/horde-webmail/lib/Horde/Kolab/Server/ldap.php +index a50ba2c..ea73b4f 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/ldap.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/ldap.php +@@ -2,7 +2,7 @@ + /** + * The driver for accessing the Kolab user database stored in LDAP. + * +- * $Horde: framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php,v 1.2.2.2 2008/08/01 07:56:19 wrobel Exp $ ++ * $Horde: framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php,v 1.2.2.10 2009/02/24 07:39:47 wrobel Exp $ + * + * PHP version 4 + * +@@ -210,6 +210,7 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + } + + if (isset($attrs)) { ++ $this->mapKeys($attrs); + $result = @ldap_read($this->_connection, $dn, '(objectclass=*)', $attrs); + } else { + $result = @ldap_read($this->_connection, $dn, '(objectclass=*)'); +@@ -220,7 +221,7 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + } + $entry = $this->_firstEntry($result); + if (!$entry) { +- ldap_free_result($result); ++ @ldap_free_result($result); + return PEAR::raiseError(sprintf(_("LDAP Error: Empty result for: %s."), + $dn)); + } +@@ -229,7 +230,10 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + return PEAR::raiseError(sprintf(_("LDAP Error: No such dn: %s: %s"), + $dn, $this->_error())); + } +- ldap_free_result($result); ++ @ldap_free_result($result); ++ ++ $this->unmapAttributes($object); ++ + return $object; + } + +@@ -250,6 +254,8 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + } + } + ++ $this->mapAttributes($data); ++ + return @ldap_add($this->_connection, $dn, $data); + } + +@@ -681,9 +687,25 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + */ + function mailForIdOrMail($id) + { +- $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. +- Horde_LDAP::quote($id) . ')(mail=' . +- Horde_LDAP::quote($id) . ')))'; ++ $criteria = array('AND' => ++ array( ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABINETORGPERSON), ++ array('OR' => ++ array( ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => $id), ++ array('field' => KOLAB_ATTR_MAIL, ++ 'op' => '=', ++ 'test' => $id), ++ ), ++ ), ++ ), ++ ); ++ $filter = $this->searchQuery($criteria); ++ + $result = $this->_attrsForFilter($filter, array('mail'), + KOLAB_SERVER_RESULT_STRICT); + if (is_a($result, 'PEAR_Error')) { +@@ -702,9 +724,24 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + */ + function uidForIdOrMail($id) + { +- $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. +- Horde_LDAP::quote($id) . ')(mail=' . +- Horde_LDAP::quote($id) . ')))'; ++ $criteria = array('AND' => ++ array( ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABINETORGPERSON), ++ array('OR' => ++ array( ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => $id), ++ array('field' => KOLAB_ATTR_MAIL, ++ 'op' => '=', ++ 'test' => $id), ++ ), ++ ), ++ ), ++ ); ++ $filter = $this->searchQuery($criteria); + return $this->_dnForFilter($filter, KOLAB_SERVER_RESULT_STRICT); + } + +@@ -717,9 +754,25 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + */ + function addrsForIdOrMail($id) + { +- $filter = '(&(objectClass=kolabInetOrgPerson)(|(mail=' +- . Horde_LDAP::quote($id) . ')(uid=' +- . Horde_LDAP::quote($id) . ')))'; ++ $criteria = array('AND' => ++ array( ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABINETORGPERSON), ++ array('OR' => ++ array( ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => $id), ++ array('field' => KOLAB_ATTR_MAIL, ++ 'op' => '=', ++ 'test' => $id), ++ ), ++ ), ++ ), ++ ); ++ $filter = $this->searchQuery($criteria); ++ + $result = $this->_attrsForFilter($filter, array('mail', 'alias'), + KOLAB_SERVER_RESULT_STRICT); + if (empty($result)) { +@@ -768,10 +821,27 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + */ + function uidForMailAddress($mail) + { +- $filter = '(&(objectClass=kolabInetOrgPerson)(|(uid='. +- Horde_LDAP::quote($mail) . ')(mail=' . +- Horde_LDAP::quote($mail) . ')(alias=' . +- Horde_LDAP::quote($mail) . ')))'; ++ $criteria = array('AND' => ++ array( ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABINETORGPERSON), ++ array('OR' => ++ array( ++ array('field' => KOLAB_ATTR_ALIAS, ++ 'op' => '=', ++ 'test' => $mail), ++ array('field' => KOLAB_ATTR_MAIL, ++ 'op' => '=', ++ 'test' => $mail), ++ array('field' => KOLAB_ATTR_SID, ++ 'op' => '=', ++ 'test' => $mail), ++ ), ++ ), ++ ), ++ ); ++ $filter = $this->searchQuery($criteria); + return $this->_dnForFilter($filter); + } + +@@ -788,8 +858,17 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + function uidForAttr($attr, $value, + $restrict = KOLAB_SERVER_RESULT_SINGLE) + { +- $filter = '(&(objectClass=kolabInetOrgPerson)(' . $attr . +- '=' . Horde_LDAP::quote($value) . '))'; ++ $criteria = array('AND' => ++ array( ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABINETORGPERSON), ++ array('field' => $attr, ++ 'op' => '=', ++ 'test' => $value), ++ ), ++ ); ++ $filter = $this->searchQuery($criteria); + return $this->_dnForFilter($filter, $restrict); + } + +@@ -806,8 +885,17 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + function gidForAttr($attr, $value, + $restrict = KOLAB_SERVER_RESULT_SINGLE) + { +- $filter = '(&(objectClass=kolabGroupOfNames)(' . $attr . +- '=' . Horde_LDAP::quote($value) . '))'; ++ $criteria = array('AND' => ++ array( ++ array('field' => KOLAB_ATTR_OC, ++ 'op' => '=', ++ 'test' => KOLAB_OC_KOLABGROUPOFNAMES), ++ array('field' => $attr, ++ 'op' => '=', ++ 'test' => $value), ++ ), ++ ); ++ $filter = $this->searchQuery($criteria); + return $this->_dnForFilter($filter, $restrict); + } + +@@ -874,7 +962,13 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + return $result; + } + $vars = get_class_vars($type); +- $filter = $vars['filter']; ++ $methods = get_class_methods($type); ++ if (!in_array('getFilter', $methods)) { ++ $filter = $vars['filter']; ++ } else { ++ $criteria = call_user_func(array($type, 'getFilter')); ++ $filter = $this->searchQuery($criteria); ++ } + $sort = $vars['sort_by']; + + if (isset($params['sort'])) { +@@ -993,4 +1087,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server { + } + } + ++ /** ++ * Build a search query. ++ * ++ * Taken from the Turba LDAP driver. ++ * ++ * @param array $criteria The array of criteria. ++ * ++ * @return string An LDAP query filter. ++ */ ++ public function searchQuery($criteria) ++ { ++ require_once 'Net/LDAP2.php'; ++ ++ /* Accept everything. */ ++ $filter = '(' . strtolower(KOLAB_ATTR_OC) . '=*)'; ++ ++ /* Build the LDAP filter. */ ++ if (count($criteria)) { ++ $f = $this->buildSearchQuery($criteria); ++ if (is_a($f, 'Net_LDAP2_Filter')) { ++ $filter = $f->asString(); ++ } ++ } ++ return $filter; ++ } ++ ++ /** ++ * Build a piece of a search query. ++ * ++ * Taken from the Turba LDAP driver. ++ * ++ * @param array $criteria The array of criteria. ++ * ++ * @return string An LDAP query fragment. ++ */ ++ protected function &buildSearchQuery($criteria) ++ { ++ if (isset($criteria['field'])) { ++ require_once 'Horde/String.php'; ++ require_once 'Horde/NLS.php'; ++ $rhs = $criteria['test']; ++ /* Keep this in for reference as we did not really test servers with different encoding yet */ ++ //$rhs = String::convertCharset($criteria['test'], NLS::getCharset(), $this->params['charset']); ++ switch ($criteria['op']) { ++ case '=': ++ $op = 'equals'; ++ break; ++ } ++ return Net_LDAP2_Filter::create($this->mapField($criteria['field']), ++ $op, $rhs); ++ } ++ foreach ($criteria as $key => $vals) { ++ if (!empty($vals['OR']) ++ || !empty($vals['AND']) ++ || !empty($vals['NOT'])) { ++ $parts = $this->buildSearchQuery($vals); ++ if (count($parts) > 1) { ++ if (!empty($vals['OR'])) { ++ $operator = '|'; ++ } else if (!empty($vals['NOT'])) { ++ $operator = '!'; ++ } else { ++ $operator = '&'; ++ } ++ return Net_LDAP2_Filter::combine($operator, $parts); ++ } else { ++ return $parts[0]; ++ } ++ } else { ++ $parts = array(); ++ foreach ($vals as $test) { ++ $parts[] = &$this->buildSearchQuery($test); ++ } ++ switch ($key) { ++ case 'OR': ++ $operator = '|'; ++ break; ++ case 'AND': ++ $operator = '&'; ++ break; ++ case 'NOT': ++ $operator = '!'; ++ break; ++ } ++ if (count($parts) > 1) { ++ return Net_LDAP2_Filter::combine($operator, $parts); ++ } else if ($operator == '!') { ++ return Net_LDAP2_Filter::combine($operator, $parts[0]); ++ } else { ++ return $parts[0]; ++ } ++ } ++ } ++ } ++ ++ /** ++ * Map attributes defined within this library their their real world ++ * counterparts. ++ * ++ * @param array $data The data that has been read and needs to be mapped. ++ * ++ * @return NULL ++ */ ++ protected function unmapAttributes(&$data) ++ { ++ if (!empty($this->_params['map'])) { ++ foreach ($this->_params['map'] as $attribute => $map) { ++ if (isset($data[$map])) { ++ $data[$attribute] = $data[$map]; ++ unset($data[$map]); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Map attributes defined within this library into their real world ++ * counterparts. ++ * ++ * @param array $data The data to be written. ++ * ++ * @return NULL ++ */ ++ protected function mapAttributes(&$data) ++ { ++ if (!empty($this->_params['map'])) { ++ foreach ($this->_params['map'] as $attribute => $map) { ++ if (isset($data[$attribute])) { ++ $data[$map] = $data[$attribute]; ++ unset($data[$attribute]); ++ } ++ } ++ } ++ } ++ ++ /** ++ * Map attribute keys defined within this library into their real world ++ * counterparts. ++ * ++ * @param array $keys The attribute keys. ++ * ++ * @return NULL ++ */ ++ protected function mapKeys(&$keys) ++ { ++ if (!empty($this->_params['map'])) { ++ foreach ($this->_params['map'] as $attribute => $map) { ++ $key = array_search($attribute, $keys); ++ if ($key !== false) { ++ $keys[$key] = $map; ++ } ++ } ++ } ++ } ++ ++ /** ++ * Map a single attribute key defined within this library into its real ++ * world counterpart. ++ * ++ * @param array $field The attribute name. ++ * ++ * @return The real name of this attribute on the server we connect to. ++ */ ++ protected function mapField($field) ++ { ++ if (!empty($this->_params['map']) ++ && isset($this->_params['map'][$field])) { ++ return $this->_params['map'][$field]; ++ } ++ return $field; ++ } ++ + } +diff --git a/horde-webmail/lib/Horde/Kolab/Server/test.php b/horde-webmail/lib/Horde/Kolab/Server/test.php +index 47f985a..fc19c80 100644 +--- a/horde-webmail/lib/Horde/Kolab/Server/test.php ++++ b/horde-webmail/lib/Horde/Kolab/Server/test.php +@@ -247,6 +247,10 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { + } + } + ++ if (!empty($attributes)) { ++ $this->mapKeys($attributes); ++ } ++ + $filter = $this->_parse($filter); + if (is_a($filter, 'PEAR_Error')) { + return $filter; +@@ -265,6 +269,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { + $result = $subtree; + } + ++ $this->unmapAttributes($result); ++ + return $result; + } + +@@ -286,7 +292,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { + switch ($filter['log']) { + case '=': + $value = $element['data'][$filter['att']]; +- if (($filter['val'] == '*' && !empty($value)) ++ if ((($filter['val'] == '*' || $filter['val'] == '\2a') ++ && !empty($value)) + || $value == $filter['val'] + || (is_array($value) + && in_array($filter['val'], $value))) { +@@ -390,8 +397,12 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { + $dn)); + } + if (empty($attrs)) { +- return $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; ++ $data = $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; ++ $this->unmapAttributes($data); ++ return $data; + } else { ++ $this->mapKeys($attrs); ++ + $result = array(); + $data = $GLOBALS['KOLAB_SERVER_TEST_DATA'][$dn]['data']; + +@@ -401,6 +412,9 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { + array_push($result, $attr); + } + } ++ ++ $this->unmapAttributes($result); ++ + $result['count'] = 1; + return $result; + } +@@ -423,6 +437,8 @@ class Horde_Kolab_Server_test extends Horde_Kolab_Server_ldap { + } + } + ++ $this->mapAttributes($data); ++ + $ldap_data = array(); + foreach ($data as $key => $val) { + if (!is_array($val)) { +-- +tg: (0ad87da..) t/Kolab_Server/HK/GW/MappableAttributes (depends on: t/pear/HK/GW/AddNetLDAP2) +-- +TOPGIT patch commit log +======================= + +commit 296112ac1021e0433ca9578a700c8f066bc139a9 +Author: Gunnar Wrobel

+Date: Fri Apr 24 19:30:10 2009 +0200 + + Fixed mapping of attributes. Fixed uidForAttr and gidForAttr. + +commit a2525f3bf8a77431e4cd28bd92e1cb9fec14e392 +Author: Gunnar Wrobel

+Date: Thu Apr 23 13:45:14 2009 +0200 + + Allow to configurable LDAP attribute mapping. +From: Gunnar Wrobel

Subject: [PATCH] t/framework/HK/GW/Prefs/FileDriverHotfix.diff A hotfix for https://issues.kolab.org/issue3555 From cvs at kolab.org Tue Oct 13 16:06:29 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 16:06:29 +0200 (CEST) Subject: wilde: server/pear/PEAR-Net_LDAP2 .cvsignore, NONE, 1.4.2.1 ChangeLog, NONE, 1.3.2.1 Makefile, NONE, 1.3.2.1 PEAR-Net_LDAP2.spec, NONE, 1.3.2.1 Message-ID: <20091013140629.65D18600174@lists.intevation.de> Author: wilde Update of /kolabrepository/server/pear/PEAR-Net_LDAP2 In directory doto:/tmp/cvs-serv16613/PEAR-Net_LDAP2 Added Files: Tag: kolab_2_2_branch .cvsignore ChangeLog Makefile PEAR-Net_LDAP2.spec Log Message: Added new package PEAR-Net_LDAP2. Needed for ldap attribute mapping. --- NEW FILE: .cvsignore --- *.src.rpm --- NEW FILE: ChangeLog --- 2009-04-23 Gunnar Wrobel

* PEAR-Net_LDAP2.spec: Added package to Kolab CVS. --- NEW FILE: Makefile --- PEAR_NAME = $(shell grep "%define[ ]*V_pear_name" *.spec | sed -e "s/.*V_pear_name \([A-Za-z0-9\-\_]*\).*/\1/") PACKAGE = PEAR-$(PEAR_NAME) VERSION = $(shell grep "%define[ ]*V_version" *.spec | sed -e "s/.*V_version\s*\([A-Za-z0-9RC.]*\).*/\1/") RELEASE = $(shell grep "%define[ ]*V_release" *.spec | sed -e "s/.*V_release\s*\([0-9]*\).*/\1/") ifeq "x$(RPM)" "x" RPM = $(HOME)/bin/openpkg rpm endif ifeq "x$(KOLABRPMSRC)" "x" KOLABRPMSRC = $(HOME)/RPM/SRC endif ifeq "x$(KOLABRPMPKG)" "x" KOLABRPMPKG = $(HOME)/RPM/PKG endif ifeq "x$(KOLABRPMTMP)" "x" KOLABRPMTMP = $(HOME)/RPM/TMP endif SOURCE_0=http://pear.php.net/get/$(PEAR_NAME)-$(VERSION).tgz .PHONY: all all: $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm .PHONY: dist dist: all cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm ../../stage/ .PHONY: clean clean: rm -rf /kolab/RPM/TMP/$(PEAR_NAME)* rm -rf /kolab/RPM/TMP/$(PACKAGE) rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm rm -rf *~ $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm: Makefile $(PACKAGE).spec ChangeLog test -d $(KOLABRPMSRC)/$(PACKAGE) || mkdir $(KOLABRPMSRC)/$(PACKAGE) cd $(KOLABRPMSRC)/$(PACKAGE) && wget -c "$(SOURCE_0)" cp $(PACKAGE).spec $(KOLABRPMSRC)/$(PACKAGE) cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -ba $(PACKAGE).spec cp -p $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm . --- NEW FILE: PEAR-Net_LDAP2.spec --- # Variables %define V_pear_name Net_LDAP2 %define V_package PEAR-%{V_pear_name} %define V_version 2.0.0RC5 %define V_release 1 # Package Information Name: %{V_package} Summary: Object oriented interface for searching and manipulating LDAP-entries URL: http://pear.php.net/package/%{V_pear_name} Packager: Gunnar Wrobel (p at rdus) Version: %{V_version} Release: %{V_release} License: LGPL License Group: Development/Libraries Distribution: OpenPKG # List of Sources Source: http://pear.php.net/get/%{V_pear_name}-%{V_version}.tgz # Build Info Prefix: %{l_prefix} BuildRoot: %{l_buildroot} #Pre requisites BuildPreReq: OpenPKG, openpkg >= 20070603 BuildPreReq: php, php::with_pear = yes PreReq: OpenPKG, openpkg >= 20070603 PreReq: php, php::with_pear = yes PreReq: PEAR-Net_Socket >= 1.0 PreReq: PEAR-Auth_SASL %description Net_LDAP2 is the successor of Net_LDAP which is a clone of Perls Net::LDAP object interface to directory servers. It does contain most of Net::LDAPs features but has some own too. With Net_LDAP2 you have: * A simple object-oriented interface to connections, searches entries and filters. * Support for tls and ldap v3. * Simple modification, deletion and creation of ldap entries. * Support for schema handling. %prep %setup -n %{V_pear_name}-%{V_version} %build %install env PHP_PEAR_PHP_BIN="%{l_prefix}/bin/php -d safe_mode=off -d memory_limit=40M" \ PHP_PEAR_CACHE_DIR="/tmp/pear/cache" \ %{l_prefix}/bin/pear install --offline --force --nodeps -P $RPM_BUILD_ROOT $RPM_SOURCE_DIR/%{V_pear_name}-%{V_version}.tgz rm -rf $RPM_BUILD_ROOT/%{l_prefix}/lib/php/{.filemap,.lock,.channels,.depdb,.depdblock} %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} %clean rm -rf $RPM_BUILD_ROOT %files -f files From cvs at kolab.org Tue Oct 13 17:58:54 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 17:58:54 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_SB_SaveEventAttendees.diff, 1.3, 1.3.2.1 Message-ID: <20091013155854.709A6600171@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv20591/patches/horde-webmail/1.2.0/tg Modified Files: Tag: kolab_2_2_branch t_kronolith_HK_SB_SaveEventAttendees.diff Log Message: Translations and minor display improvements in dimp. (Merged from sug branch) Index: t_kronolith_HK_SB_SaveEventAttendees.diff =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/t_kronolith_HK_SB_SaveEventAttendees.diff,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- t_kronolith_HK_SB_SaveEventAttendees.diff 9 Feb 2009 14:25:55 -0000 1.3 +++ t_kronolith_HK_SB_SaveEventAttendees.diff 13 Oct 2009 15:58:52 -0000 1.3.2.1 @@ -10,11 +10,12 @@ --- horde-webmail/kronolith/attendees.php | 18 +++++ horde-webmail/kronolith/config/prefs.php.dist | 8 ++ + horde-webmail/kronolith/po/de_DE.po | 6 ++ horde-webmail/kronolith/savedattlist.php | 77 ++++++++++++++++++++ .../kronolith/templates/attendees/attendees.inc | 2 + .../templates/javascript/open_savedattlist_win.js | 36 +++++++++ .../templates/savedattlist/savedattlist.inc | 68 +++++++++++++++++ - 6 files changed, 209 insertions(+), 0 deletions(-) + 7 files changed, 215 insertions(+), 0 deletions(-) diff --git a/horde-webmail/kronolith/attendees.php b/horde-webmail/kronolith/attendees.php index a2d8b3e..e1b15c0 100644 @@ -68,6 +69,20 @@ + 'type' => 'implicit', + 'desc' => _("A saved list of attendees") +); +diff --git a/horde-webmail/kronolith/po/de_DE.po b/horde-webmail/kronolith/po/de_DE.po +index 2b555a2..68ed35c 100644 +--- a/horde-webmail/kronolith/po/de_DE.po ++++ b/horde-webmail/kronolith/po/de_DE.po +@@ -2674,3 +2674,9 @@ msgstr "Jahr(e) am gleichen Jahrestag" + #: templates/view/view.inc:116 templates/edit/edit.inc:271 + msgid "year(s) on the same weekday and month of the year" + msgstr "Jahr(e) am gleichen Wochentag und Monat des Jahres" ++ ++msgid "Load Attendee List" ++msgstr "Teilnehmerliste laden" ++ ++msgid "Save Attendee List" ++msgstr "Teilnehmerliste speichern" diff --git a/horde-webmail/kronolith/savedattlist.php b/horde-webmail/kronolith/savedattlist.php new file mode 100644 index 0000000..631b994 @@ -282,3 +297,30 @@ + -- tg: (6938161..) t/kronolith/HK/SB/SaveEventAttendees (depends on: master) +-- +TOPGIT patch commit log +======================= + +commit 3715013c5b1c184a72130bab132e3157d7e4b0ca +Author: Gunnar Wrobel

+Date: Fri Jun 26 12:06:46 2009 +0200 + + Fixed translations. + +commit ced8db79fc783d16931dfcecea9bc823c2f5737f +Author: Gunnar Wrobel

+Date: Fri Jun 26 11:15:43 2009 +0200 + + German translations. + +commit cd7f4fe16072b7b40a1a75bd5c9a296e23bca779 +Author: Gunnar Wrobel

+Date: Sat Mar 14 01:10:10 2009 +0100 + + Remove stray .orig file. + +commit e508e429dcac35ef7ac223c771a9973f823db53f +Author: Gunnar Wrobel

+Date: Sun Feb 1 22:21:11 2009 +0000 + + Added patch kronolith/HK-SB-Fbview_save_attendees.patch from the mercurial release queue. From cvs at kolab.org Tue Oct 13 17:58:54 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Tue, 13 Oct 2009 17:58:54 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/merges t_dimp_H_GW_AclView.diff, 1.1.4.1, 1.1.4.2 t_dimp_H_GW_FoldersView.diff, 1.1.4.1, 1.1.4.2 Message-ID: <20091013155854.22C9D600171@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/merges In directory doto:/tmp/cvs-serv20591/patches/horde-webmail/1.2.0/merges Modified Files: Tag: kolab_2_2_branch t_dimp_H_GW_AclView.diff t_dimp_H_GW_FoldersView.diff Log Message: Translations and minor display improvements in dimp. (Merged from sug branch) Index: t_dimp_H_GW_AclView.diff =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/merges/Attic/t_dimp_H_GW_AclView.diff,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -d -r1.1.4.1 -r1.1.4.2 --- t_dimp_H_GW_AclView.diff 14 May 2009 16:17:37 -0000 1.1.4.1 +++ t_dimp_H_GW_AclView.diff 13 Oct 2009 15:58:51 -0000 1.1.4.2 @@ -12,12 +12,14 @@ Signed-off-by: Gunnar Wrobel

--- - horde-webmail/dimp/js/DimpBase.js | 1 + - horde-webmail/dimp/lib/DIMP.php | 1 + - horde-webmail/dimp/templates/index/index.inc | 1 + - horde-webmail/imp/acl.php | 12 ++++++++++-- - horde-webmail/imp/templates/acl/acl.html | 6 ++++++ - 5 files changed, 19 insertions(+), 2 deletions(-) + horde-webmail/dimp/js/DimpBase.js | 1 + + horde-webmail/dimp/lib/DIMP.php | 1 + + .../dimp/locale/de_DE/LC_MESSAGES/dimp.mo | Bin 168731 -> 168778 bytes + horde-webmail/dimp/po/de_DE.po | 3 +++ + horde-webmail/dimp/templates/index/index.inc | 1 + + horde-webmail/imp/acl.php | 12 ++++++++++-- + horde-webmail/imp/templates/acl/acl.html | 13 +++++++++++++ + 7 files changed, 29 insertions(+), 2 deletions(-) diff --git a/horde-webmail/dimp/js/DimpBase.js b/horde-webmail/dimp/js/DimpBase.js index 39a728b..c4eb9f4 100644 @@ -43,6 +45,20 @@ 'sortthread' => SORTTHREAD, 'sortdate' => SORTDATE, +diff --git a/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo b/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo +index 2f1c11c..973776f 100644 +Binary files a/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo and b/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo differ +diff --git a/horde-webmail/dimp/po/de_DE.po b/horde-webmail/dimp/po/de_DE.po +index a536db6..0486297 100644 +--- a/horde-webmail/dimp/po/de_DE.po ++++ b/horde-webmail/dimp/po/de_DE.po +@@ -791,3 +791,6 @@ msgstr "entfernen" + #: lib/DIMP.php:191 + msgid "results found" + msgstr "Ergebnisse gefunden" ++ ++msgid "Share Folder" ++msgstr "Berechtigungen" diff --git a/horde-webmail/dimp/templates/index/index.inc b/horde-webmail/dimp/templates/index/index.inc index 21939e0..7c02fe7 100644 --- a/horde-webmail/dimp/templates/index/index.inc @@ -85,26 +101,38 @@ $t->set('sharedimg', Horde::img('shared.png', _("Change Folder"))); $t->set('options', IMP::flistSelect('', true, array(), $folder)); diff --git a/horde-webmail/imp/templates/acl/acl.html b/horde-webmail/imp/templates/acl/acl.html -index 79580aa..72cf1c5 100644 +index 79580aa..ae85ff4 100644 --- a/horde-webmail/imp/templates/acl/acl.html +++ b/horde-webmail/imp/templates/acl/acl.html -@@ -7,6 +7,7 @@ +@@ -2,11 +2,14 @@ + + + ++ +

+ Share mail folders
++ +
  • -@@ -17,6 +18,7 @@ +@@ -17,6 +20,12 @@
++ ++
++ ++
++
+
-@@ -76,9 +78,13 @@ +@@ -76,9 +85,13 @@ @@ -119,10 +147,22 @@   -- -tg: (3c3721f..) t/dimp/H/GW/AclView (depends on: t/dimp/H/GW/FoldersView) +tg: (f251c16..) t/dimp/H/GW/AclView (depends on: t/dimp/H/GW/FoldersView) -- TOPGIT patch commit log ======================= + +commit e9630629c7479c73d3eb156f00544c34e95f0597 +Author: Gunnar Wrobel

+Date: Mon Jul 20 09:36:01 2009 +0200 + + Fix translation and improve header. + +commit 57041c04c322dd7dc57da5b171923b7ab000ec0a +Author: Gunnar Wrobel

+Date: Sun Jun 21 23:58:30 2009 +0200 + + German translation. commit cac1482cec6c96a8a1d7fb7c0e8c2433877728f5 Author: Gunnar Wrobel

Index: t_dimp_H_GW_FoldersView.diff =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/merges/Attic/t_dimp_H_GW_FoldersView.diff,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -d -r1.1.4.1 -r1.1.4.2 --- t_dimp_H_GW_FoldersView.diff 14 May 2009 16:22:39 -0000 1.1.4.1 +++ t_dimp_H_GW_FoldersView.diff 13 Oct 2009 15:58:51 -0000 1.1.4.2 @@ -12,28 +12,46 @@ Signed-off-by: Gunnar Wrobel

--- - horde-webmail/dimp/config/menu.php | 6 ++++++ + horde-webmail/dimp/config/menu.php | 9 ++++++++- + horde-webmail/dimp/po/de_DE.po | 3 +++ horde-webmail/imp/folders.php | 17 ++++++++++++----- horde-webmail/imp/templates/folders/actions.html | 2 ++ - 3 files changed, 20 insertions(+), 5 deletions(-) + 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/horde-webmail/dimp/config/menu.php b/horde-webmail/dimp/config/menu.php -index 5dcf354..99a4b8c 100644 +index 0c6ebe9..b5e0a5c 100644 --- a/horde-webmail/dimp/config/menu.php +++ b/horde-webmail/dimp/config/menu.php -@@ -28,6 +28,12 @@ +@@ -28,7 +28,14 @@ // 'text' => 'Say Hi!', // 'icon' => $GLOBALS['registry']->getImageDir('horde') . '/horde.png'), // ); ++ +$site_menu = array( + 'folders' => array( + 'action' => 'DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")', -+ 'text' => _('Folders'), -+ 'icon' => $GLOBALS['registry']->getImageDir('imp') . '/folders/folder.png'), ++ 'text' => _('Folder Subscription'), ++ 'icon' => $GLOBALS['registry']->getImageDir('horde') . '/prefs.png'), +); ++ if (file_exists(dirname(__FILE__) . '/menu.local.php')) { - require_once(dirname(__FILE__) . '/menu.local.php'); + require(dirname(__FILE__) . '/menu.local.php'); } +- +diff --git a/horde-webmail/dimp/po/de_DE.po b/horde-webmail/dimp/po/de_DE.po +index 65e8824..a536db6 100644 +--- a/horde-webmail/dimp/po/de_DE.po ++++ b/horde-webmail/dimp/po/de_DE.po +@@ -16,6 +16,9 @@ msgstr "" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + ++msgid "Folder Subscription" ++msgstr "Ordner verwalten" ++ + #: lib/Views/ShowMessage.php:295 + #, php-format + msgid "%d Attachment" diff --git a/horde-webmail/imp/folders.php b/horde-webmail/imp/folders.php index a0425aa..c46b0e5 100644 --- a/horde-webmail/imp/folders.php @@ -103,10 +121,22 @@ -- -tg: (eff636a..) t/dimp/H/GW/FoldersView (depends on: t/kronolith/H/GW/UseDayHourStartEndAlsoInFBView) +tg: (3678979..) t/dimp/H/GW/FoldersView (depends on: t/kronolith/H/GW/UseDayHourStartEndAlsoInFBView) -- TOPGIT patch commit log ======================= + +commit 93403a869ff14d7868d4cc9c4687ea1270e3c225 +Author: Gunnar Wrobel

+Date: Mon Jun 22 08:39:51 2009 +0200 + + Typo + +commit ad147a4b42d61800400a2a779e884ee050358811 +Author: Gunnar Wrobel

+Date: Mon Jun 22 00:06:14 2009 +0200 + + Fixed menu entry name, added translation, fixed image. commit a1966161022108d9bf4831a8613b1db9a4e68c4d Author: Gunnar Wrobel

From cvs at kolab.org Thu Oct 15 17:15:05 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Thu, 15 Oct 2009 17:15:05 +0200 (CEST) Subject: wilde: server/kolab-webclient kolab-webclient.spec, 1.23.2.14, 1.23.2.15 Message-ID: <20091015151505.B19FB60081F@lists.intevation.de> Author: wilde Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv801/kolab-webclient Modified Files: Tag: kolab_2_2_branch kolab-webclient.spec Log Message: Fix to close context menu in dimp on outside clicks. (Merged from suc branch) Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.14 retrieving revision 1.23.2.15 diff -u -d -r1.23.2.14 -r1.23.2.15 --- kolab-webclient.spec 13 Oct 2009 12:37:27 -0000 1.23.2.14 +++ kolab-webclient.spec 15 Oct 2009 15:15:03 -0000 1.23.2.15 @@ -3,7 +3,7 @@ %define V_package kolab-webclient %define V_year 2009 %define V_month 10 -%define V_day 13 +%define V_day 15 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 From cvs at kolab.org Thu Oct 15 17:15:06 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Thu, 15 Oct 2009 17:15:06 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0/merges t_dimp_H_BL_CloseContextMenu.diff, NONE, 1.1.4.1 series, 1.1.2.3, 1.1.2.4 Message-ID: <20091015151506.2AD2F60081F@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0/merges In directory doto:/tmp/cvs-serv801/patches/horde-webmail/1.2.0/merges Modified Files: Tag: kolab_2_2_branch series Added Files: Tag: kolab_2_2_branch t_dimp_H_BL_CloseContextMenu.diff Log Message: Fix to close context menu in dimp on outside clicks. (Merged from suc branch) --- NEW FILE: t_dimp_H_BL_CloseContextMenu.diff --- From: Gunnar Wrobel

Subject: [PATCH] t/dimp/H/BL/CloseContextMenu Close the context menu when clicking into the Dimp menu. Provided by Boris Lorbeer Signed-off-by: Gunnar Wrobel

--- horde-webmail/dimp/config/menu.php | 2 +- horde-webmail/dimp/js/DimpBase.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/horde-webmail/dimp/config/menu.php b/horde-webmail/dimp/config/menu.php index b5e0a5c..a079da6 100644 --- a/horde-webmail/dimp/config/menu.php +++ b/horde-webmail/dimp/config/menu.php @@ -31,7 +31,7 @@ $site_menu = array( 'folders' => array( - 'action' => 'DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")', + 'action' => 'DimpCore.DMenu.close(); DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")', 'text' => _('Folder Subscription'), 'icon' => $GLOBALS['registry']->getImageDir('horde') . '/prefs.png'), ); diff --git a/horde-webmail/dimp/js/DimpBase.js b/horde-webmail/dimp/js/DimpBase.js index c4eb9f4..d90f09b 100644 --- a/horde-webmail/dimp/js/DimpBase.js +++ b/horde-webmail/dimp/js/DimpBase.js @@ -1507,6 +1507,7 @@ var DimpBase = { case 'folder': case 'special': + DimpCore.DMenu.close(); e.stop(); return this.go('folder:' + li.readAttribute('mbox')); break; @@ -1903,7 +1904,7 @@ var DimpBase = { tmp = $('applicationfolders'); if (tmp) { tmp.select('ul li.custom a').each(function(s) { - C({ d: s, f: this.go.bind(this, 'app:' + s.readAttribute('app')) }); + C({ d: s, f: function(data){DimpCore.DMenu.close(); this.go('app:' + s.readAttribute('app'), data)}.bind(this) }); }, this); } -- tg: (19ee6e6..) t/dimp/H/BL/CloseContextMenu (depends on: t/kronolith/HK/GW/AnonymousiCalDownload) -- TOPGIT patch commit log ======================= commit b4b3190a4fb88e1843ff86adde4897dea21046db Author: Gunnar Wrobel

Date: Mon Jul 20 09:39:24 2009 +0200 Close the context menu when clicking into the Dimp menu. Index: series =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/merges/Attic/series,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- series 14 May 2009 16:22:39 -0000 1.1.2.3 +++ series 15 Oct 2009 15:15:04 -0000 1.1.2.4 @@ -2,3 +2,4 @@ issue3329.patch t_dimp_H_GW_AclView.diff t_dimp_H_GW_FoldersView.diff +t_dimp_H_BL_CloseContextMenu.diff From cvs at kolab.org Thu Oct 15 17:15:06 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Thu, 15 Oct 2009 17:15:06 +0200 (CEST) Subject: wilde: server/patches/horde-webmail/1.2.0 horde-webmail-1.2.0_kolab_openpkg.patch, 1.32.2.14, 1.32.2.15 Message-ID: <20091015151506.81EBB60081F@lists.intevation.de> Author: wilde Update of /kolabrepository/server/patches/horde-webmail/1.2.0 In directory doto:/tmp/cvs-serv801/patches/horde-webmail/1.2.0 Modified Files: Tag: kolab_2_2_branch horde-webmail-1.2.0_kolab_openpkg.patch Log Message: Fix to close context menu in dimp on outside clicks. (Merged from suc branch) Index: horde-webmail-1.2.0_kolab_openpkg.patch =================================================================== RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/Attic/horde-webmail-1.2.0_kolab_openpkg.patch,v retrieving revision 1.32.2.14 retrieving revision 1.32.2.15 diff -u -d -r1.32.2.14 -r1.32.2.15 --- horde-webmail-1.2.0_kolab_openpkg.patch 13 Oct 2009 13:24:07 -0000 1.32.2.14 +++ horde-webmail-1.2.0_kolab_openpkg.patch 15 Oct 2009 15:15:03 -0000 1.32.2.15 @@ -14254,11 +14254,12 @@ --- horde-webmail/kronolith/attendees.php | 18 +++++ horde-webmail/kronolith/config/prefs.php.dist | 8 ++ + horde-webmail/kronolith/po/de_DE.po | 6 ++ horde-webmail/kronolith/savedattlist.php | 77 ++++++++++++++++++++ .../kronolith/templates/attendees/attendees.inc | 2 + .../templates/javascript/open_savedattlist_win.js | 36 +++++++++ .../templates/savedattlist/savedattlist.inc | 68 +++++++++++++++++ - 6 files changed, 209 insertions(+), 0 deletions(-) + 7 files changed, 215 insertions(+), 0 deletions(-) diff --git a/horde-webmail/kronolith/attendees.php b/horde-webmail/kronolith/attendees.php index a2d8b3e..e1b15c0 100644 @@ -14312,6 +14313,20 @@ + 'type' => 'implicit', + 'desc' => _("A saved list of attendees") +); +diff --git a/horde-webmail/kronolith/po/de_DE.po b/horde-webmail/kronolith/po/de_DE.po +index 2b555a2..68ed35c 100644 +--- a/horde-webmail/kronolith/po/de_DE.po ++++ b/horde-webmail/kronolith/po/de_DE.po +@@ -2674,3 +2674,9 @@ msgstr "Jahr(e) am gleichen Jahrestag" + #: templates/view/view.inc:116 templates/edit/edit.inc:271 + msgid "year(s) on the same weekday and month of the year" + msgstr "Jahr(e) am gleichen Wochentag und Monat des Jahres" ++ ++msgid "Load Attendee List" ++msgstr "Teilnehmerliste laden" ++ ++msgid "Save Attendee List" ++msgstr "Teilnehmerliste speichern" diff --git a/horde-webmail/kronolith/savedattlist.php b/horde-webmail/kronolith/savedattlist.php new file mode 100644 index 0000000..631b994 @@ -14526,6 +14541,33 @@ +

-- tg: (6938161..) t/kronolith/HK/SB/SaveEventAttendees (depends on: master) +-- +TOPGIT patch commit log +======================= + +commit 3715013c5b1c184a72130bab132e3157d7e4b0ca +Author: Gunnar Wrobel

+Date: Fri Jun 26 12:06:46 2009 +0200 + + Fixed translations. + +commit ced8db79fc783d16931dfcecea9bc823c2f5737f +Author: Gunnar Wrobel

+Date: Fri Jun 26 11:15:43 2009 +0200 + + German translations. + +commit cd7f4fe16072b7b40a1a75bd5c9a296e23bca779 +Author: Gunnar Wrobel

+Date: Sat Mar 14 01:10:10 2009 +0100 + + Remove stray .orig file. + +commit e508e429dcac35ef7ac223c771a9973f823db53f +Author: Gunnar Wrobel

+Date: Sun Feb 1 22:21:11 2009 +0000 + + Added patch kronolith/HK-SB-Fbview_save_attendees.patch from the mercurial release queue. From: Gunnar Wrobel

Subject: [PATCH] t/kronolith/HK/SB/ExtraParameters @@ -27656,12 +27698,14 @@ Signed-off-by: Gunnar Wrobel

--- - horde-webmail/dimp/js/DimpBase.js | 1 + - horde-webmail/dimp/lib/DIMP.php | 1 + - horde-webmail/dimp/templates/index/index.inc | 1 + - horde-webmail/imp/acl.php | 12 ++++++++++-- - horde-webmail/imp/templates/acl/acl.html | 6 ++++++ - 5 files changed, 19 insertions(+), 2 deletions(-) + horde-webmail/dimp/js/DimpBase.js | 1 + + horde-webmail/dimp/lib/DIMP.php | 1 + + .../dimp/locale/de_DE/LC_MESSAGES/dimp.mo | Bin 168731 -> 168778 bytes + horde-webmail/dimp/po/de_DE.po | 3 +++ + horde-webmail/dimp/templates/index/index.inc | 1 + + horde-webmail/imp/acl.php | 12 ++++++++++-- + horde-webmail/imp/templates/acl/acl.html | 13 +++++++++++++ + 7 files changed, 29 insertions(+), 2 deletions(-) diff --git a/horde-webmail/dimp/js/DimpBase.js b/horde-webmail/dimp/js/DimpBase.js index 39a728b..c4eb9f4 100644 @@ -27687,6 +27731,20 @@ 'sortthread' => SORTTHREAD, 'sortdate' => SORTDATE, +diff --git a/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo b/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo +index 2f1c11c..973776f 100644 +Binary files a/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo and b/horde-webmail/dimp/locale/de_DE/LC_MESSAGES/dimp.mo differ +diff --git a/horde-webmail/dimp/po/de_DE.po b/horde-webmail/dimp/po/de_DE.po +index a536db6..0486297 100644 +--- a/horde-webmail/dimp/po/de_DE.po ++++ b/horde-webmail/dimp/po/de_DE.po +@@ -791,3 +791,6 @@ msgstr "entfernen" + #: lib/DIMP.php:191 + msgid "results found" + msgstr "Ergebnisse gefunden" ++ ++msgid "Share Folder" ++msgstr "Berechtigungen" diff --git a/horde-webmail/dimp/templates/index/index.inc b/horde-webmail/dimp/templates/index/index.inc index 21939e0..7c02fe7 100644 --- a/horde-webmail/dimp/templates/index/index.inc @@ -27729,26 +27787,38 @@ $t->set('sharedimg', Horde::img('shared.png', _("Change Folder"))); $t->set('options', IMP::flistSelect('', true, array(), $folder)); diff --git a/horde-webmail/imp/templates/acl/acl.html b/horde-webmail/imp/templates/acl/acl.html -index 79580aa..72cf1c5 100644 +index 79580aa..ae85ff4 100644 --- a/horde-webmail/imp/templates/acl/acl.html +++ b/horde-webmail/imp/templates/acl/acl.html -@@ -7,6 +7,7 @@ +@@ -2,11 +2,14 @@ + + + ++ +

+ Share mail folders
++ +
  • -@@ -17,6 +18,7 @@ +@@ -17,6 +20,12 @@
++ ++
++ ++
++
+
-@@ -76,9 +78,13 @@ +@@ -76,9 +85,13 @@ @@ -27763,11 +27833,23 @@   -- -tg: (3c3721f..) t/dimp/H/GW/AclView (depends on: t/dimp/H/GW/FoldersView) +tg: (f251c16..) t/dimp/H/GW/AclView (depends on: t/dimp/H/GW/FoldersView) -- TOPGIT patch commit log ======================= +commit e9630629c7479c73d3eb156f00544c34e95f0597 +Author: Gunnar Wrobel

+Date: Mon Jul 20 09:36:01 2009 +0200 + + Fix translation and improve header. + +commit 57041c04c322dd7dc57da5b171923b7ab000ec0a +Author: Gunnar Wrobel

+Date: Sun Jun 21 23:58:30 2009 +0200 + + German translation. + commit cac1482cec6c96a8a1d7fb7c0e8c2433877728f5 Author: Gunnar Wrobel

Date: Fri Mar 13 12:04:03 2009 +0000 @@ -27799,28 +27881,46 @@ Signed-off-by: Gunnar Wrobel

--- - horde-webmail/dimp/config/menu.php | 6 ++++++ + horde-webmail/dimp/config/menu.php | 9 ++++++++- + horde-webmail/dimp/po/de_DE.po | 3 +++ horde-webmail/imp/folders.php | 17 ++++++++++++----- horde-webmail/imp/templates/folders/actions.html | 2 ++ - 3 files changed, 20 insertions(+), 5 deletions(-) + 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/horde-webmail/dimp/config/menu.php b/horde-webmail/dimp/config/menu.php -index 5dcf354..99a4b8c 100644 +index 0c6ebe9..b5e0a5c 100644 --- a/horde-webmail/dimp/config/menu.php +++ b/horde-webmail/dimp/config/menu.php -@@ -28,6 +28,12 @@ +@@ -28,7 +28,14 @@ // 'text' => 'Say Hi!', // 'icon' => $GLOBALS['registry']->getImageDir('horde') . '/horde.png'), // ); ++ +$site_menu = array( + 'folders' => array( + 'action' => 'DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")', -+ 'text' => _('Folders'), -+ 'icon' => $GLOBALS['registry']->getImageDir('imp') . '/folders/folder.png'), ++ 'text' => _('Folder Subscription'), ++ 'icon' => $GLOBALS['registry']->getImageDir('horde') . '/prefs.png'), +); ++ if (file_exists(dirname(__FILE__) . '/menu.local.php')) { - require_once(dirname(__FILE__) . '/menu.local.php'); + require(dirname(__FILE__) . '/menu.local.php'); } +- +diff --git a/horde-webmail/dimp/po/de_DE.po b/horde-webmail/dimp/po/de_DE.po +index 65e8824..a536db6 100644 +--- a/horde-webmail/dimp/po/de_DE.po ++++ b/horde-webmail/dimp/po/de_DE.po +@@ -16,6 +16,9 @@ msgstr "" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + ++msgid "Folder Subscription" ++msgstr "Ordner verwalten" ++ + #: lib/Views/ShowMessage.php:295 + #, php-format + msgid "%d Attachment" diff --git a/horde-webmail/imp/folders.php b/horde-webmail/imp/folders.php index a0425aa..c46b0e5 100644 --- a/horde-webmail/imp/folders.php @@ -27890,11 +27990,23 @@ -- -tg: (eff636a..) t/dimp/H/GW/FoldersView (depends on: t/kronolith/H/GW/UseDayHourStartEndAlsoInFBView) +tg: (3678979..) t/dimp/H/GW/FoldersView (depends on: t/kronolith/H/GW/UseDayHourStartEndAlsoInFBView) -- TOPGIT patch commit log ======================= +commit 93403a869ff14d7868d4cc9c4687ea1270e3c225 +Author: Gunnar Wrobel

+Date: Mon Jun 22 08:39:51 2009 +0200 + + Typo + +commit ad147a4b42d61800400a2a779e884ee050358811 +Author: Gunnar Wrobel

+Date: Mon Jun 22 00:06:14 2009 +0200 + + Fixed menu entry name, added translation, fixed image. + commit a1966161022108d9bf4831a8613b1db9a4e68c4d Author: Gunnar Wrobel

Date: Fri Mar 13 11:06:45 2009 +0000 @@ -27918,3 +28030,62 @@ Date: Sun Mar 8 19:01:41 2009 +0000 Completed the hack. +From: Gunnar Wrobel

+Subject: [PATCH] t/dimp/H/BL/CloseContextMenu + +Close the context menu when clicking into the Dimp menu. + +Provided by Boris Lorbeer + +Signed-off-by: Gunnar Wrobel

+ +--- + horde-webmail/dimp/config/menu.php | 2 +- + horde-webmail/dimp/js/DimpBase.js | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/horde-webmail/dimp/config/menu.php b/horde-webmail/dimp/config/menu.php +index b5e0a5c..a079da6 100644 +--- a/horde-webmail/dimp/config/menu.php ++++ b/horde-webmail/dimp/config/menu.php +@@ -31,7 +31,7 @@ + + $site_menu = array( + 'folders' => array( +- 'action' => 'DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")', ++ 'action' => 'DimpCore.DMenu.close(); DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")', + 'text' => _('Folder Subscription'), + 'icon' => $GLOBALS['registry']->getImageDir('horde') . '/prefs.png'), + ); +diff --git a/horde-webmail/dimp/js/DimpBase.js b/horde-webmail/dimp/js/DimpBase.js +index c4eb9f4..d90f09b 100644 +--- a/horde-webmail/dimp/js/DimpBase.js ++++ b/horde-webmail/dimp/js/DimpBase.js +@@ -1507,6 +1507,7 @@ var DimpBase = { + + case 'folder': + case 'special': ++ DimpCore.DMenu.close(); + e.stop(); + return this.go('folder:' + li.readAttribute('mbox')); + break; +@@ -1903,7 +1904,7 @@ var DimpBase = { + tmp = $('applicationfolders'); + if (tmp) { + tmp.select('ul li.custom a').each(function(s) { +- C({ d: s, f: this.go.bind(this, 'app:' + s.readAttribute('app')) }); ++ C({ d: s, f: function(data){DimpCore.DMenu.close(); this.go('app:' + s.readAttribute('app'), data)}.bind(this) }); + }, this); + } + +-- +tg: (19ee6e6..) t/dimp/H/BL/CloseContextMenu (depends on: t/kronolith/HK/GW/AnonymousiCalDownload) +-- +TOPGIT patch commit log +======================= + +commit b4b3190a4fb88e1843ff86adde4897dea21046db +Author: Gunnar Wrobel

+Date: Mon Jul 20 09:39:24 2009 +0200 + + Close the context menu when clicking into the Dimp menu. From cvs at kolab.org Fri Oct 30 17:34:03 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 30 Oct 2009 17:34:03 +0100 (CET) Subject: thomas: server release-notes.txt,1.398.2.57,1.398.2.58 Message-ID: <20091030163403.4864C600148@lists.intevation.de> Author: thomas Update of /kolabrepository/server In directory doto:/tmp/cvs-serv8955 Modified Files: Tag: kolab_2_2_branch release-notes.txt Log Message: kolab/issue3513 (Clamav - new upstream version 0.95.3) Index: release-notes.txt =================================================================== RCS file: /kolabrepository/server/release-notes.txt,v retrieving revision 1.398.2.57 retrieving revision 1.398.2.58 diff -u -d -r1.398.2.57 -r1.398.2.58 --- release-notes.txt 12 Oct 2009 14:09:00 -0000 1.398.2.57 +++ release-notes.txt 30 Oct 2009 16:34:00 -0000 1.398.2.58 @@ -45,6 +45,10 @@ Changes between 2.2.2 and 2.2.3: + - clamav-0.95.3-20091030 + + kolab/issue3513 (Clamav - new upstream version 0.95.3) + - db-4.5.20.2-20070628_kolab1 kolab/issue2982 (OpenLDAP segmentation fault on 64bit) From cvs at kolab.org Fri Oct 30 17:34:03 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Fri, 30 Oct 2009 17:34:03 +0100 (CET) Subject: thomas: server/clamav clamav.patch, 1.2, 1.2.2.1 clamav.spec, 1.6, 1.6.2.1 Message-ID: <20091030163403.6A248600148@lists.intevation.de> Author: thomas Update of /kolabrepository/server/clamav In directory doto:/tmp/cvs-serv8955/clamav Modified Files: Tag: kolab_2_2_branch clamav.patch clamav.spec Log Message: kolab/issue3513 (Clamav - new upstream version 0.95.3) Index: clamav.patch =================================================================== RCS file: /kolabrepository/server/clamav/clamav.patch,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- clamav.patch 2 Dec 2008 14:59:15 -0000 1.2 +++ clamav.patch 30 Oct 2009 16:34:01 -0000 1.2.2.1 @@ -1,108 +1,43 @@ -diff -urN clamav-0.94.1.orig/clamav-milter/clamav-milter.c clamav-0.94.1/clamav-milter/clamav-milter.c ---- clamav-0.94.1.orig/clamav-milter/clamav-milter.c 2008-10-16 10:29:55.000000000 +0200 -+++ clamav-0.94.1/clamav-milter/clamav-milter.c 2008-11-17 12:29:53.149435000 +0100 -@@ -77,9 +77,7 @@ - #include - #include - #include --#if HAVE_LIBMILTER_MFAPI_H +diff -urN clamav-0.95.3.orig/clamav-milter/clamav-milter.c clamav-0.95.3/clamav-milter/clamav-milter.c +--- clamav-0.95.3.orig/clamav-milter/clamav-milter.c 2009-10-28 16:34:13.000000000 +0100 ++++ clamav-0.95.3/clamav-milter/clamav-milter.c 2009-10-30 17:14:50.137580674 +0100 +@@ -32,7 +32,7 @@ + #include + #endif + #include -#include --#endif +#include "milter/mfapi.h" - #include - #include - #include -@@ -113,6 +111,8 @@ - - #ifdef C_LINUX - #include /* FIXME: use sendfile on BSD not Linux */ -+#endif -+#if 0 - #include - #include -@@ -435,6 +435,10 @@ - * Send a 550 rejection when a virus is - * found - */ -+static int nosubject = 0; /* -+ * Do not change the Subject header -+ * in case a virus is found. -+ */ - static int hflag = 0; /* - * Include original message headers in - * report -@@ -679,6 +683,7 @@ - puts(_("\t--max-childen\t\t-m\tMaximum number of concurrent scans.")); - puts(_("\t--outgoing\t\t-o\tScan outgoing messages from this machine.")); - puts(_("\t--noreject\t\t-N\tDon't reject viruses, silently throw them away.")); -+ puts(_("\t--nosubject\t\t-N\tDon't change Subject header.")); - puts(_("\t--noxheader\t\t-n\tSuppress X-Virus-Scanned/X-Virus-Status headers.")); - puts(_("\t--pidfile=FILE\t\t-i FILE\tLocation of pidfile.")); - puts(_("\t--postmaster\t\t-p EMAIL\tPostmaster address [default=postmaster].")); -@@ -774,7 +779,7 @@ - else - progname = "clamav-milter"; - --#ifdef C_LINUX -+#if 0 - setlocale(LC_ALL, ""); - bindtextdomain(progname, DATADIR"/clamav-milter/locale"); - textdomain(progname); -@@ -863,6 +868,9 @@ - "noreject", 0, NULL, 'N' - }, - { -+ "nosubject", 0, NULL, 'Z' -+ }, -+ { - "noxheader", 0, NULL, 'n' - }, - { -@@ -1037,6 +1045,9 @@ - case 'N': /* Do we reject mail or silently drop it */ - rejectmail = 0; - break; -+ case 'Z': -+ nosubject = 1; -+ break; - case 'o': /* scan outgoing mail */ - oflag++; - break; -@@ -1142,11 +1153,13 @@ - } - port = argv[optind]; + #include "clamav.h" -+#if 0 - if(rootdir == NULL) /* FIXME: Handle CHROOT */ - if(checkCF && verifyIncomingSocketName(port) < 0) { - fprintf(stderr, _("%s: socket-addr (%s) doesn't agree with sendmail.cf\n"), argv[0], port); - return EX_CONFIG; - } -+#endif +diff -urN clamav-0.95.3.orig/clamav-milter/clamfi.c clamav-0.95.3/clamav-milter/clamfi.c +--- clamav-0.95.3.orig/clamav-milter/clamfi.c 2009-10-28 16:34:13.000000000 +0100 ++++ clamav-0.95.3/clamav-milter/clamfi.c 2009-10-30 17:14:50.137580674 +0100 +@@ -29,7 +29,7 @@ + #include + #include - if(strncasecmp(port, "inet:", 5) == 0) - if(!lflag) { -@@ -5260,6 +5273,7 @@ - struct privdata *privdata = (struct privdata *)smfi_getpriv(ctx); - char subject[128]; +-#include ++#include "milter/mfapi.h" -+ if (!nosubject) { - if(privdata->subject) - smfi_addheader(ctx, "X-Original-Subject", privdata->subject); + #include "shared/optparser.h" + #include "shared/output.h" +diff -urN clamav-0.95.3.orig/clamav-milter/clamfi.h clamav-0.95.3/clamav-milter/clamfi.h +--- clamav-0.95.3.orig/clamav-milter/clamfi.h 2009-07-06 15:21:58.000000000 +0200 ++++ clamav-0.95.3/clamav-milter/clamfi.h 2009-10-30 17:14:50.137580674 +0100 +@@ -22,7 +22,7 @@ + #define _CLAMFI_H -@@ -5268,6 +5282,7 @@ - smfi_chgheader(ctx, "Subject", 1, subject); - else - smfi_addheader(ctx, "Subject", subject); -+ } - } + #include "shared/optparser.h" +-#include ++#include "milter/mfapi.h" - #if 0 -diff -urN clamav-0.94.1.orig/configure clamav-0.94.1/configure ---- clamav-0.94.1.orig/configure 2008-10-30 17:12:07.000000000 +0100 -+++ clamav-0.94.1/configure 2008-11-17 12:32:01.499435000 +0100 -@@ -18454,9 +18454,6 @@ + extern uint64_t maxfilesize; + extern int addxvirus; +diff -urN clamav-0.95.3.orig/configure clamav-0.95.3/configure +--- clamav-0.95.3.orig/configure 2009-10-28 16:34:13.000000000 +0100 ++++ clamav-0.95.3/configure 2009-10-30 17:15:15.994173225 +0100 +@@ -16692,9 +16692,6 @@ save_LIBS="$LIBS" CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" @@ -110,21 +45,49 @@ - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter" - fi LIBS="$LIBS -lmilter $CLAMAV_MILTER_LIBS" - { echo "$as_me:$LINENO: checking for mi_stop in -lmilter" >&5 - echo $ECHO_N "checking for mi_stop in -lmilter... $ECHO_C" >&6; } -@@ -18684,7 +18681,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mi_stop in -lmilter" >&5 + $as_echo_n "checking for mi_stop in -lmilter... " >&6; } +@@ -16834,7 +16831,7 @@ + CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_XLIB $CLAMAV_MILTER_LIBS" + else + +- as_fn_error "Cannot find libmilter" "$LINENO" 5 ++ as_fn_error "Cannot find milter" "$LINENO" 5 + + fi + +@@ -16842,10 +16839,10 @@ + fi LIBS="$save_LIBS" +- for ac_header in libmilter/mfapi.h ++ for ac_header in milter/mfapi.h + do : +- ac_fn_c_check_header_mongrel "$LINENO" "libmilter/mfapi.h" "ac_cv_header_libmilter_mfapi_h" "$ac_includes_default" +-if test "x$ac_cv_header_libmilter_mfapi_h" = x""yes; then : ++ ac_fn_c_check_header_mongrel "$LINENO" "milter/mfapi.h" "ac_cv_header_milter_mfapi_h" "$ac_includes_default" ++if test "x$ac_cv_header_milter_mfapi_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBMILTER_MFAPI_H 1 + _ACEOF +diff -urN clamav-0.95.3.orig/libclamav/others.c clamav-0.95.3/libclamav/others.c +--- clamav-0.95.3.orig/libclamav/others.c 2009-10-28 16:34:13.000000000 +0100 ++++ clamav-0.95.3/libclamav/others.c 2009-10-30 17:14:50.141580766 +0100 +@@ -177,8 +177,10 @@ + if(is_rar_initd) return; + is_rar_initd = 1; --for ac_header in libmilter/mfapi.h -+for ac_header in milter/mfapi.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then -diff -urN clamav-0.94.1.orig/shared/output.c clamav-0.94.1/shared/output.c ---- clamav-0.94.1.orig/shared/output.c 2008-08-16 19:18:00.000000000 +0200 -+++ clamav-0.94.1/shared/output.c 2008-11-17 12:29:53.169435000 +0100 -@@ -61,7 +61,7 @@ ++#if 0 + rhandle = lt_dlfind("libclamunrar_iface", "unrar"); + if (!rhandle) ++#endif + return; + + if (!(cli_unrar_open = (int(*)(int, const char *, unrar_state_t *))lt_dlsym(rhandle, "libclamunrar_iface_LTX_unrar_open")) || +diff -urN clamav-0.95.3.orig/shared/output.c clamav-0.95.3/shared/output.c +--- clamav-0.95.3.orig/shared/output.c 2009-10-28 16:34:13.000000000 +0100 ++++ clamav-0.95.3/shared/output.c 2009-10-30 17:14:50.141580766 +0100 +@@ -67,7 +67,7 @@ pthread_mutex_t logg_mutex = PTHREAD_MUTEX_INITIALIZER; #endif Index: clamav.spec =================================================================== RCS file: /kolabrepository/server/clamav/clamav.spec,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- clamav.spec 12 Dec 2008 14:54:49 -0000 1.6 +++ clamav.spec 30 Oct 2009 16:34:01 -0000 1.6.2.1 @@ -1,6 +1,6 @@ ## ## clamav.spec -- OpenPKG RPM Package Specification -## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## Copyright (c) 2000-2009 OpenPKG Foundation e.V. ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that @@ -29,8 +29,8 @@ Packager: Intevation GmbH Group: AntiVirus License: GPL -Version: 0.94.2 -Release: 20081212 +Version: 0.95.3 +Release: 20091030 # package options %option with_milter no @@ -43,8 +43,8 @@ # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 2.4.3, gcc, bzip2 -PreReq: OpenPKG, openpkg >= 2.4.3 +BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, bzip2, pkgconfig, bc +PreReq: OpenPKG, openpkg >= 20060823 BuildPreReq: zlib, bzip2, curl, gmp, libiconv, openssl PreReq: zlib, bzip2, curl, gmp, libiconv, openssl %if "%{with_milter}" == "yes" @@ -67,7 +67,7 @@ %track prog clamav = { version = %{version} - url = http://prdownloads.sourceforge.net/clamav/ + url = http://sourceforge.net/projects/clamav/files/ regex = clamav-(\d+\.\d+(\.\d+)*)\.tar\.gz } @@ -78,7 +78,7 @@ %build # configure package CC="%{l_cc}" \ - CFLAGS="%{l_cflags}" \ + CFLAGS="%{l_cflags -O}" \ CPPFLAGS="%{l_cppflags}" \ LDFLAGS="%{l_ldflags}" \ GREP="grep" \ @@ -101,6 +101,7 @@ %else --disable-milter \ %endif + --disable-unrar \ --disable-shared # build package From cvs at kolab.org Thu Nov 5 12:14:10 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Thu, 5 Nov 2009 12:14:10 +0100 (CET) Subject: gunnar: server/kolab-webclient ChangeLog, 1.10.2.10, 1.10.2.11 kolab-webclient.spec, 1.23.2.15, 1.23.2.16 Message-ID: <20091105111410.A2F0E60081D@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/kolab-webclient In directory doto:/tmp/cvs-serv9695/kolab-webclient Modified Files: Tag: kolab_2_2_branch ChangeLog kolab-webclient.spec Log Message: kolab/issue3844 (New user preference to specify order of date input fields) Index: ChangeLog =================================================================== RCS file: /kolabrepository/server/kolab-webclient/ChangeLog,v retrieving revision 1.10.2.10 retrieving revision 1.10.2.11 diff -u -d -r1.10.2.10 -r1.10.2.11 --- ChangeLog 13 Oct 2009 12:37:27 -0000 1.10.2.10 +++ ChangeLog 5 Nov 2009 11:14:08 -0000 1.10.2.11 @@ -1,3 +1,8 @@ +2009-11-05 Gunnar Wrobel

+ + * kolab-webclient.spec: kolab/issue3844 (New user preference to + specify order of date input fields) + 2009-10-09 Gunnar Wrobel

* kolab-webclient.spec: Cleaner session handling for the export. Index: kolab-webclient.spec =================================================================== RCS file: /kolabrepository/server/kolab-webclient/kolab-webclient.spec,v retrieving revision 1.23.2.15 retrieving revision 1.23.2.16 diff -u -d -r1.23.2.15 -r1.23.2.16 --- kolab-webclient.spec 15 Oct 2009 15:15:03 -0000 1.23.2.15 +++ kolab-webclient.spec 5 Nov 2009 11:14:08 -0000 1.23.2.16 @@ -2,8 +2,8 @@ %define V_horde_name horde-webmail %define V_package kolab-webclient %define V_year 2009 -%define V_month 10 -%define V_day 15 +%define V_month 11 +%define V_day 05 %define V_version 1.2.0 %define V_source_version 1.2 %define V_passwd_version 3.0.1 From cvs at kolab.org Thu Nov 5 12:14:11 2009 From: cvs at kolab.org (cvs@kolab.org) Date: Thu, 5 Nov 2009 12:14:11 +0100 (CET) Subject: gunnar: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_UV_dateInputFieldOrder.diff, NONE, 1.1.2.1 series, 1.5.2.8, 1.5.2.9 Message-ID: <20091105111411.1A0A060081D@lists.intevation.de> Author: gunnar Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg In directory doto:/tmp/cvs-serv9695/patches/horde-webmail/1.2.0/tg Modified Files: Tag: kolab_2_2_branch series Added Files: Tag: kolab_2_2_branch t_kronolith_HK_UV_dateInputFieldOrder.diff Log Message: kolab/issue3844 (New user preference to specify order of date input fields) --- NEW FILE: t_kronolith_HK_UV_dateInputFieldOrder.diff --- From: Soenke Schwardt-Krummrich Subject: [PATCH] t/kronolith/HK/UV/dateInputFieldOrder Currently in kronolith the order of date input fields is hardcoded to year-month-day. Some parts of the world usually use a different order. The attached patch adds a user preference to specify input field order. REFERENCE_KOLAB: https://issues.kolab.org/issue3844 REFERENCE_HORDE: STATUS_KOLAB_2.2: UNTESTED STATUS_KOLAB_2.3: NONE STATUS_HORDE_KRONOLITH_2.3.3: SUBMIT STATUS_HORDE_KRONOLITH_3.0: SUBMIT Signed-off-by: Gunnar Wrobel

--- horde-webmail/config/prefs.php | 17 ++++++++++- horde-webmail/config/prefs.php.dist | 17 ++++++++++- .../kronolith/templates/edit/edit_timespan.inc | 30 +++++++++++++------ 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/horde-webmail/config/prefs.php b/horde-webmail/config/prefs.php index c9e5d80..e3c591b 100644 --- a/horde-webmail/config/prefs.php +++ b/horde-webmail/config/prefs.php @@ -105,7 +105,7 @@ $prefGroups['language'] = array( 'column' => _("Your Information"), 'label' => _("Locale and Time"), 'desc' => _("Set your preferred language, timezone and date options."), - 'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'first_week_day') + 'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'date_input_format', 'first_week_day') ); $prefGroups['categories'] = array( @@ -346,6 +346,21 @@ $_prefs['date_format'] = array( 'desc' => _("Choose how to display dates:"), ); +// date input format +$_prefs['date_input_format'] = array( + 'value' => 'year-month-day', + 'locked' => false, + 'shared' => true, + 'type' => 'enum', + 'enum' => array( + 'day-month-year' => strftime('%d %b %Y'), + 'month-day-year' => strftime('%b %d %Y'), + 'year-day-month' => strftime('%Y %d %b'), + 'year-month-day' => strftime('%Y %b %d'), + ), + 'desc' => _("Choose order how to enter dates:"), +); + // what day should be displayed as the first day of the week? $_prefs['first_week_day'] = array( 'value' => '0', diff --git a/horde-webmail/config/prefs.php.dist b/horde-webmail/config/prefs.php.dist index 6e513ae..2d745f9 100644 --- a/horde-webmail/config/prefs.php.dist +++ b/horde-webmail/config/prefs.php.dist @@ -105,7 +105,7 @@ $prefGroups['language'] = array( 'column' => _("Your Information"), 'label' => _("Locale and Time"), 'desc' => _("Set your preferred language, timezone and date options."), - 'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'first_week_day') + 'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'date_input_format', 'first_week_day') ); $prefGroups['categories'] = array( @@ -344,6 +344,21 @@ $_prefs['date_format'] = array( 'desc' => _("Choose how to display dates:"), ); +// date input format +$_prefs['date_input_format'] = array( + 'value' => 'year-month-day', + 'locked' => false, + 'shared' => true, + 'type' => 'enum', + 'enum' => array( + 'day-month-year' => strftime('%d %b %Y'), + 'month-day-year' => strftime('%b %d %Y'), + 'year-day-month' => strftime('%Y %d %b'), + 'year-month-day' => strftime('%Y %b %d'), + ), + 'desc' => _("Choose order how to enter dates:"), +); + // what day should be displayed as the first day of the week? $_prefs['first_week_day'] = array( 'value' => '0', diff --git a/horde-webmail/kronolith/templates/edit/edit_timespan.inc b/horde-webmail/kronolith/templates/edit/edit_timespan.inc index 9926617..05f5042 100644 --- a/horde-webmail/kronolith/templates/edit/edit_timespan.inc +++ b/horde-webmail/kronolith/templates/edit/edit_timespan.inc @@ -12,11 +12,16 @@   - html('start[year]') ?> - - - html('start[month]') ?> - - - html('start[day]') ?> + getValue('date_input_format'); + $dateorder = $dateorder != "" ? $dateorder : "year-month-day"; + $dateorder = explode("-", $dateorder ); + $datefields = array(); + foreach ($dateorder as $fld) { + $datefields[] = $event->html('start['.$fld.']'); + } + echo implode("-", $datefields); + ?> hasFeature('dom')): ?>