|
|
|
@ -1009,7 +1009,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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1530,8 +1530,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);
|
|
|
|
@ -1543,7 +1550,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;
|
|
|
|
|