LSldap : fix/improve getAttr() method

This commit is contained in:
Benjamin Renard 2018-04-27 15:39:24 +02:00
parent 788bc23b98
commit baeea8d670

View file

@ -194,12 +194,7 @@ class LSldap {
$infos = ldap_explode_dn($dn,0); $infos = ldap_explode_dn($dn,0);
if((!$infos)||($infos['count']==0)) if((!$infos)||($infos['count']==0))
return; return;
$basedn=''; $return=self :: search('(objectClass=*)',$dn);
for ($i=1;$i<$infos['count'];$i++) {
$sep=($basedn=='')?'':',';
$basedn.=$sep.$infos[$i];
}
$return=self :: search($infos[0],$basedn);
return $return[0]['attrs']; return $return[0]['attrs'];
} }