LSldap::search() : updated way to iterate search result

This commit is contained in:
Benjamin Renard 2012-08-02 15:51:49 +02:00
parent 809cb9adfa
commit dc5648272e

View file

@ -111,12 +111,12 @@ class LSldap {
}
LSdebug("LSldap::search() : return ".$ret->count()." objet(s)");
$retInfos=array();
foreach($ret -> entries() as $entry) {
foreach($ret as $dn => $entry) {
if (!$entry instanceof Net_LDAP2_Entry) {
LSerror :: addErrorCode('LSldap_02',"LDAP search return an ".get_class($entry).". object");
continue;
}
$retInfos[]=array('dn' => $entry -> dn(), 'attrs' => $entry -> getValues());
$retInfos[]=array('dn' => $dn, 'attrs' => $entry -> getValues());
}
return $retInfos;
}