[turba] Fw: patch for ldap.php
Christophe Réquillart
Christophe.Requillart at bull.net
Mon Apr 14 20:27:35 PDT 2003
Hi,
I have some patches for the file /var/www/html/horde/turba/lib/driver/ldap.php :
1/ ldap_get_entries returns attribute names as lowercase. This is a problem in the getResults function.
2/ the attribute $this->params['dn'] is not necessary an array. It can be a string as "uid=time()" if there no unique identifier in the data stored in the addressbook. For this problem I just add an else condition to get the attribute.
I have one suggestion : why don't you create a class TurbaPerson instead of doing some patches in the core.schema of the ldap server ? It will be easier of modifer this class !
Here is the patch :
239a240
> $field_l = strtolower($field);
241c242
< $result[$field] = $entry[$field];
---
> $result[$field] = $entry[$field_l];
244,245c245,246
< if (!empty($entry[$field])) {
< for ($j = 0; $j < $entry[$field]['count']; $j++) {
---
> if (!empty($entry[$field_l])) {
> for ($j = 0; $j < $entry[$field_l]['count']; $j++) {
250c251
< $result[$field] .= utf8_decode($entry[$field][$j]);
---
> $result[$field] .= utf8_decode($entry[$field_l][$j]);
252c253
< $result[$field] .= $entry[$field][$j];
---
> $result[$field] .= $entry[$field_l][$j];
417c418,420
< }
---
> } else {
> $dn = $this->params['dn'].',';
> }
More information about the turba
mailing list