summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2009-04-24 17:42:20 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2009-04-24 17:42:20 (GMT)
commitd8a0b3d802f93276c6bfa5c6b5c2cd918df3fe66 (patch)
tree36035ac10bff5773721f56ded4ebd7ac2ff1f34f
parent50bb4b2dff95ef80c7dd33cce9b1132c1968fdf2 (diff)
downloadserver-d8a0b3d802f93276c6bfa5c6b5c2cd918df3fe66.tar.gz
Additional fixes for configurable mapping
of LDAP attributes.
-rw-r--r--kolab-webclient/ChangeLog5
-rw-r--r--kolab-webclient/kolab-webclient.spec4
-rw-r--r--patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch90
-rw-r--r--patches/horde-webmail/1.2.0/tg/t_Kolab__Server_HK_GW_MappableAttributes.diff90
4 files changed, 163 insertions, 26 deletions
diff --git a/kolab-webclient/ChangeLog b/kolab-webclient/ChangeLog
index 7c728d3..011afb8 100644
--- a/kolab-webclient/ChangeLog
+++ b/kolab-webclient/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-24 Gunnar Wrobel <p@rdus.de>
+
+ * kolab-webclient.spec: Additional fixes for configurable mapping
+ of LDAP attributes.
+
2009-04-23 Gunnar Wrobel <p@rdus.de>
* kolab-webclient.spec: Support for configurable mapping of LDAP
diff --git a/kolab-webclient/kolab-webclient.spec b/kolab-webclient/kolab-webclient.spec
index a25f704..6b200de 100644
--- a/kolab-webclient/kolab-webclient.spec
+++ b/kolab-webclient/kolab-webclient.spec
@@ -3,12 +3,12 @@
%define V_package kolab-webclient
%define V_year 2009
%define V_month 04
-%define V_day 23
+%define V_day 24
%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}suc05
+%define V_release %{V_year}%{V_month}%{V_day}suc01
# Package Information
Name: %{V_package}
diff --git a/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch b/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch
index 5fa9d05..b932a57 100644
--- a/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch
+++ b/patches/horde-webmail/1.2.0/horde-webmail-1.2.0_kolab_openpkg.patch
@@ -26040,13 +26040,13 @@ Signed-off-by: Gunnar Wrobel <p@rdus.de>
.../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/group.php | 23 +-
.../lib/Horde/Kolab/Server/Object/server.php | 21 ++-
- .../lib/Horde/Kolab/Server/Object/sharedfolder.php | 23 ++-
+ .../lib/Horde/Kolab/Server/Object/sharedfolder.php | 23 +-
.../lib/Horde/Kolab/Server/Object/user.php | 32 ++-
- horde-webmail/lib/Horde/Kolab/Server/ldap.php | 276 +++++++++++++++++++-
+ horde-webmail/lib/Horde/Kolab/Server/ldap.php | 308 ++++++++++++++++++--
horde-webmail/lib/Horde/Kolab/Server/test.php | 20 ++-
- 11 files changed, 442 insertions(+), 68 deletions(-)
+ 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
@@ -26432,9 +26432,18 @@ index d4e57a0..b702a4f 100644
*
* @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..2f39d47 100644
+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 {
}
@@ -26443,10 +26452,21 @@ index a50ba2c..2f39d47 100644
$result = @ldap_read($this->_connection, $dn, '(objectclass=*)', $attrs);
} else {
$result = @ldap_read($this->_connection, $dn, '(objectclass=*)');
-@@ -230,6 +231,9 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
+@@ -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);
++ @ldap_free_result($result);
+
+ $this->unmapAttributes($object);
+
@@ -26580,7 +26600,47 @@ index a50ba2c..2f39d47 100644
return $this->_dnForFilter($filter);
}
-@@ -874,7 +944,13 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
+@@ -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);
@@ -26595,7 +26655,7 @@ index a50ba2c..2f39d47 100644
$sort = $vars['sort_by'];
if (isset($params['sort'])) {
-@@ -993,4 +1069,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
+@@ -993,4 +1087,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
}
}
@@ -26746,9 +26806,9 @@ index a50ba2c..2f39d47 100644
+ {
+ if (!empty($this->_params['map'])) {
+ foreach ($this->_params['map'] as $attribute => $map) {
-+ if (in_array($attribute, $keys)) {
-+ $keys = array_diff($keys, array($attribute));
-+ $keys[] = $map;
++ $key = array_search($attribute, $keys);
++ if ($key !== false) {
++ $keys[$key] = $map;
+ }
+ }
+ }
@@ -26845,6 +26905,12 @@ tg: (0ad87da..) t/Kolab_Server/HK/GW/MappableAttributes (depends on: t/pear/HK/G
TOPGIT patch commit log
=======================
+commit 296112ac1021e0433ca9578a700c8f066bc139a9
+Author: Gunnar Wrobel <p@rdus.de>
+Date: Fri Apr 24 19:30:10 2009 +0200
+
+ Fixed mapping of attributes. Fixed uidForAttr and gidForAttr.
+
commit a2525f3bf8a77431e4cd28bd92e1cb9fec14e392
Author: Gunnar Wrobel <p@rdus.de>
Date: Thu Apr 23 13:45:14 2009 +0200
diff --git a/patches/horde-webmail/1.2.0/tg/t_Kolab__Server_HK_GW_MappableAttributes.diff b/patches/horde-webmail/1.2.0/tg/t_Kolab__Server_HK_GW_MappableAttributes.diff
index 79b3b26..ba082ca 100644
--- a/patches/horde-webmail/1.2.0/tg/t_Kolab__Server_HK_GW_MappableAttributes.diff
+++ b/patches/horde-webmail/1.2.0/tg/t_Kolab__Server_HK_GW_MappableAttributes.diff
@@ -11,13 +11,13 @@ Signed-off-by: Gunnar Wrobel <p@rdus.de>
.../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/group.php | 23 +-
.../lib/Horde/Kolab/Server/Object/server.php | 21 ++-
- .../lib/Horde/Kolab/Server/Object/sharedfolder.php | 23 ++-
+ .../lib/Horde/Kolab/Server/Object/sharedfolder.php | 23 +-
.../lib/Horde/Kolab/Server/Object/user.php | 32 ++-
- horde-webmail/lib/Horde/Kolab/Server/ldap.php | 276 +++++++++++++++++++-
+ horde-webmail/lib/Horde/Kolab/Server/ldap.php | 308 ++++++++++++++++++--
horde-webmail/lib/Horde/Kolab/Server/test.php | 20 ++-
- 11 files changed, 442 insertions(+), 68 deletions(-)
+ 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
@@ -403,9 +403,18 @@ index d4e57a0..b702a4f 100644
*
* @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..2f39d47 100644
+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 {
}
@@ -414,10 +423,21 @@ index a50ba2c..2f39d47 100644
$result = @ldap_read($this->_connection, $dn, '(objectclass=*)', $attrs);
} else {
$result = @ldap_read($this->_connection, $dn, '(objectclass=*)');
-@@ -230,6 +231,9 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
+@@ -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);
++ @ldap_free_result($result);
+
+ $this->unmapAttributes($object);
+
@@ -551,7 +571,47 @@ index a50ba2c..2f39d47 100644
return $this->_dnForFilter($filter);
}
-@@ -874,7 +944,13 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
+@@ -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);
@@ -566,7 +626,7 @@ index a50ba2c..2f39d47 100644
$sort = $vars['sort_by'];
if (isset($params['sort'])) {
-@@ -993,4 +1069,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
+@@ -993,4 +1087,176 @@ class Horde_Kolab_Server_ldap extends Horde_Kolab_Server {
}
}
@@ -717,9 +777,9 @@ index a50ba2c..2f39d47 100644
+ {
+ if (!empty($this->_params['map'])) {
+ foreach ($this->_params['map'] as $attribute => $map) {
-+ if (in_array($attribute, $keys)) {
-+ $keys = array_diff($keys, array($attribute));
-+ $keys[] = $map;
++ $key = array_search($attribute, $keys);
++ if ($key !== false) {
++ $keys[$key] = $map;
+ }
+ }
+ }
@@ -816,6 +876,12 @@ tg: (0ad87da..) t/Kolab_Server/HK/GW/MappableAttributes (depends on: t/pear/HK/G
TOPGIT patch commit log
=======================
+commit 296112ac1021e0433ca9578a700c8f066bc139a9
+Author: Gunnar Wrobel <p@rdus.de>
+Date: Fri Apr 24 19:30:10 2009 +0200
+
+ Fixed mapping of attributes. Fixed uidForAttr and gidForAttr.
+
commit a2525f3bf8a77431e4cd28bd92e1cb9fec14e392
Author: Gunnar Wrobel <p@rdus.de>
Date: Thu Apr 23 13:45:14 2009 +0200