|
|
|
@ -1017,7 +1017,7 @@ class rcube_ldap extends rcube_addressbook
|
|
|
|
|
if ($this->ready && $dn) {
|
|
|
|
|
$dn = self::dn_decode($dn);
|
|
|
|
|
|
|
|
|
|
if ($rec = $this->ldap->get_entry($dn)) {
|
|
|
|
|
if ($rec = $this->ldap->get_entry($dn, $this->prop['attributes'])) {
|
|
|
|
|
$rec = array_change_key_case($rec, CASE_LOWER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1538,8 +1538,15 @@ class rcube_ldap extends rcube_addressbook
|
|
|
|
|
|
|
|
|
|
foreach ($fieldmap as $rf => $lf)
|
|
|
|
|
{
|
|
|
|
|
for ($i=0; $i < $rec[$lf]['count']; $i++) {
|
|
|
|
|
if (!($value = $rec[$lf][$i]))
|
|
|
|
|
// we might be dealing with normalized and non-normalized data
|
|
|
|
|
$entry = $rec[$lf];
|
|
|
|
|
if (!is_array($entry) || !isset($entry['count'])) {
|
|
|
|
|
$entry = (array) $entry;
|
|
|
|
|
$entry['count'] = count($entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for ($i=0; $i < $entry['count']; $i++) {
|
|
|
|
|
if (!($value = $entry[$i]))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
list($col, $subtype) = explode(':', $rf);
|
|
|
|
@ -1551,7 +1558,7 @@ class rcube_ldap extends rcube_addressbook
|
|
|
|
|
$out['address' . ($subtype ? ':' : '') . $subtype][$i][$col] = $value;
|
|
|
|
|
else if ($col == 'address' && strpos($value, '$') !== false) // address data is represented as string separated with $
|
|
|
|
|
list($out[$rf][$i]['street'], $out[$rf][$i]['locality'], $out[$rf][$i]['zipcode'], $out[$rf][$i]['country']) = explode('$', $value);
|
|
|
|
|
else if ($rec[$lf]['count'] > 1)
|
|
|
|
|
else if ($entry['count'] > 1)
|
|
|
|
|
$out[$rf][] = $value;
|
|
|
|
|
else
|
|
|
|
|
$out[$rf] = $value;
|
|
|
|
|