[Tickets #2529] Problems with "cn", "name" and ldap (patch)
bugs@bugs.horde.org
bugs at bugs.horde.org
Sun Sep 11 08:20:36 PDT 2005
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=2529
-----------------------------------------------------------------------
Ticket | 2529
Updated By | horde at olen.net
Summary | Problems with "cn", "name" and ldap (patch)
Queue | Turba
Version | FRAMEWORK_3
State | Feedback
Priority | 1. Low
Type | Enhancement
Owners |
-----------------------------------------------------------------------
horde at olen.net (2005-09-11 08:20) wrote:
New patch.
I extended the map-array with a 'attr' field (if anyone have a better name,
feel free to change it):
'name' => array('fields' => array('firstname', 'lastname'),
'format' => '%s %s',
'attr' => 'cn'),
And then I added the following to Driver.php:
--- Driver.php.orig 2005-08-30 12:39:52.000000000 +0200
+++ Driver.php 2005-09-11 17:13:31.000000000 +0200
@@ -141,8 +141,18 @@
{
$fields = array();
foreach ($hash as $key => $val) {
- if (isset($this->map[$key]) && !is_array($this->map[$key])) {
- $fields[$this->map[$key]] = $val;
+ if (isset($this->map[$key])) {
+ if (!is_array($this->map[$key])) {
+ $fields[$this->map[$key]] = $val;
+ }
+ elseif ($this->map[$key]['attr']) {
+ $fieldarray = array();
+ foreach ($this->map[$key]['fields'] as $mapfields) {
+ $fieldarray[] = $hash[$mapfields];
+
+ }
+ $fields[$this->map[$key]['attr']] =
vsprintf($this->map[$key]['format'], $fieldarray);
+ }
}
}
return $fields;
More information about the bugs
mailing list