unknown
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/18/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#2529] Problems with "cn", "name" and ldap (patch)
*
Your Email Address
*
Spam protection
Enter the letters below:
.__ .__ .__ .___.___. | \[__)[__)[__ _/ |__/| [__)[___./__.
Comment
> Another patch to Driver.php to make sure we can import addresses from > imp, even when "name" is set as staed above. > > > > --- turba/lib/Driver.php.orig 2005-08-30 11:09:44.000000000 +0200 > > +++ turba/lib/Driver.php 2005-08-30 12:33:41.000000000 +0200 > > @@ -141,8 +141,38 @@ > > { > > $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; > > + } > > + else { > > + $map = $this->map[$key]; > > + > > + $mapfields = $map['fields']; > > + $mapformat = $map['format']; > > + $values = sscanf($val, $mapformat); > > + // To make sure we get ALL values, even if the > format does not specify > > + // enough arguments... > > + if (vsprintf($mapformat, $values) != $val) { > > + $format .= " %[^[]]"; > > + $values = sscanf($val, $format); > > + } > > + // Now this is ugly! BUT... > > + // I believe this is mos widely used for names, > and to make sure > > + // Firstname Middlename Lastname is parsed > correctly (with > > + // Middlename as part of Givenname, I had to do > it this way. > > + // IE. map from the end of the array. > > + // Should this be made configureable? > > + while ($field = array_pop($mapfields)) { > > + if ($mapfields[0]) { > > + $value = array_pop($values); > > + } > > + else { > > + $value = join(" ", $values); > > + } > > + $fields[$this->map[$field]] = $value; > > + } > > + } > > } > > } > > return $fields; > >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers