function LDAPInterface::retrieveAttributes in LDAP integration 6
Same name and namespace in other branches
- 5.2 ldap_integration/LDAPInterface.php \LDAPInterface::retrieveAttributes()
- 5 ldap_integration/LDAPInterface.php \LDAPInterface::retrieveAttributes()
Retrieve all or some of the attributes for the ldap dn.
WARNING! WARNING! WARNING! This function returns its entries with lowercase attribute names. Don't blame me, blame PHP's own ldap_get_entries()
Parameters
String $dn Required - The full dn to the object:
Array $attributes Optional - an array of specific attributes to: retrieve. See ldap_read.
2 calls to LDAPInterface::retrieveAttributes()
- LDAPInterface::retrieveAttribute in includes/LDAPInterface.inc 
- LDAPInterface::retrieveMultiAttribute in includes/LDAPInterface.inc 
File
- includes/LDAPInterface.inc, line 239 
- LDAPInterface class definition.
Class
- LDAPInterface
- @file LDAPInterface class definition.
Code
function retrieveAttributes($dn, $attributes = array()) {
  set_error_handler(array(
    'LDAPInterface',
    'void_error_handler',
  ));
  $result = ldap_read($this->connection, $dn, 'objectClass=*', $attributes);
  $entries = ldap_get_entries($this->connection, $result);
  restore_error_handler();
  return call_user_func($this->attr_filter, $this->sid, $entries[0]);
}