code/services/LDAPService.php
public function getUserByEmail($email, $attributes = [])
    {
        $searchLocations = $this->config()->users_search_locations ?: [null];
        foreach ($searchLocations as $searchLocation) {
            $records = $this->gateway->getUserByEmail($email, $searchLocation, Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes);
            if ($records) {
                return $records[0];
            }
        }
    }
public function getUserByEmail($email, $attributes = [])
    {
        $searchLocations = $this->config()->users_search_locations ?: [null];
        foreach ($searchLocations as $searchLocation) {
            $records = $this->gateway->getUserByEmail($email, $searchLocation, Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes);
            if ($records) {
                return $records[0];
            }
        }
    }
Get a specific user's data given an email.

@param string $email
@param array $attributes List of specific AD attributes to return. Empty array means return everything.
@return array