return array();
}
do {
- $attributes = array_change_key_case(ldap_get_attributes($ldapconnection, $entry), CASE_LOWER);
- for ($j = 0; $j < $attributes['count']; $j++) {
- $values = ldap_get_values_len($ldapconnection, $entry, $attributes[$j]);
+ $attributes = array();
+ $attribute = ldap_first_attribute($ldapconnection, $entry);
+ while ($attribute !== false) {
+ $attributes[] = strtolower($attribute); // Attribute names don't usually contain non-ASCII characters.
+ $attribute = ldap_next_attribute($ldapconnection, $entry);
+ }
+ foreach ($attributes as $attribute) {
+ $values = ldap_get_values_len($ldapconnection, $entry, $attribute);
if (is_array($values)) {
- $result[$i][$attributes[$j]] = $values;
+ $result[$i][$attribute] = $values;
} else {
- $result[$i][$attributes[$j]] = array($values);
+ $result[$i][$attribute] = array($values);
}
}
$i++;
if (empty($entries)) {
return false;
}
- $info = array_change_key_case($entries[0], CASE_LOWER);
+ $info = $entries[0];
if (isset($info['supportedcontrol']) && in_array(LDAP_PAGED_RESULTS_CONTROL, $info['supportedcontrol'])) {
return true;
}