Skip to content
Snippets Groups Projects
Commit 0c996dfa 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 56fd3fef
No related branches found
No related tags found
No related merge requests found
...@@ -323,21 +323,20 @@ abstract class AbstractService implements ...@@ -323,21 +323,20 @@ abstract class AbstractService implements
/** /**
* Retourne un tableau d'attributs * Retourne un tableau d'attributs
* * @param resource|\Ldap\Connection $resource
* @param resource $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();
...@@ -359,7 +358,7 @@ abstract class AbstractService implements ...@@ -359,7 +358,7 @@ abstract class AbstractService implements
$attributes[$attrName] = $data; $attributes[$attrName] = $data;
$name = ldap_next_attribute( $name = ldap_next_attribute(
$resource, $entry//, $berIdentifier $resource, $entry
); );
} }
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