You are here

function LDAPInterface::search in LDAP integration 5

Same name and namespace in other branches
  1. 5.2 ldap_integration/LDAPInterface.php \LDAPInterface::search()
  2. 6 includes/LDAPInterface.inc \LDAPInterface::search()

File

ldap_integration/LDAPInterface.php, line 163

Class

LDAPInterface

Code

function search($base_dn, $filter, $attributes = array()) {
  $ret = array();
  set_error_handler(array(
    'LDAPInterface',
    'void_error_handler',
  ));
  $x = @ldap_search($this->connection, $base_dn, $filter, $attributes);
  restore_error_handler();
  if ($x && ldap_count_entries($this->connection, $x)) {
    $ret = ldap_get_entries($this->connection, $x);
  }
  return $ret;
}