ldap_get_dn example

private function getSingleEntry($con$current): Entry
    {
        $attributes = ldap_get_attributes($con$current);

        if (false === $attributes) {
            throw new LdapException('Could not fetch attributes: '.ldap_error($con));
        }

        $attributes = $this->cleanupAttributes($attributes);

        $dn = ldap_get_dn($con$current);

        if (false === $dn) {
            throw new LdapException('Could not fetch DN: '.ldap_error($con));
        }

        return new Entry($dn$attributes);
    }

    private function cleanupAttributes(array $entry): array
    {
        $attributes = array_diff_key($entryarray_flip(range(0, $entry['count'] - 1)) + [
                
Home | Imprint | This part of the site doesn't use cookies.