Skip to content
Snippets Groups Projects
Commit f403a6a5 authored by Thibaut Vallee's avatar Thibaut Vallee
Browse files

fixe pour php>=8.1 : ldap_get_attibutes ne prend plus une ressources mais une LDAP\Connection

parent 6d4dbed0
No related branches found
No related tags found
No related merge requests found
...@@ -326,20 +326,19 @@ abstract class AbstractService implements ...@@ -326,20 +326,19 @@ abstract class AbstractService implements
/** /**
* Retourne un tableau d'attributs * Retourne un tableau d'attributs
* *
* @param resource $resource * @param resource|\Ldap\Connection $resource
* @param resource $entry * @param resource $entry
* @return null|array * @return null|array
* @desc depuis php 8.1 $resource est de type Ldap\Connection
*/ */
private function __getEntryAttributes($resource, $entry) private function __getEntryAttributes($resource, $entry)
{ {
if (!is_resource($resource)) { if (!is_resource($resource) && !($resource instanceof \Ldap\Connection)) {
return null; return null;
} }
$berIdentifier = null;
$name = ldap_first_attribute( $name = ldap_first_attribute(
$resource, $entry, $berIdentifier $resource, $entry
); );
$attributes = array(); $attributes = array();
...@@ -361,8 +360,7 @@ abstract class AbstractService implements ...@@ -361,8 +360,7 @@ abstract class AbstractService implements
$attributes[$attrName] = $data; $attributes[$attrName] = $data;
$name = ldap_next_attribute( $name = ldap_next_attribute(
$resource, $entry, $resource, $entry
$berIdentifier
); );
} }
ksort($attributes, SORT_LOCALE_STRING); ksort($attributes, SORT_LOCALE_STRING);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment