mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
LSldap :: getAttrs: add possibility to specify to custom LDAP filter
This commit is contained in:
parent
9bb52296b7
commit
252095b32b
1 changed files with 7 additions and 3 deletions
|
@ -192,12 +192,16 @@ class LSldap extends LSlog_staticLoggerClass {
|
|||
*
|
||||
* @retval array Tableau associatif des valeurs des attributs avec en clef, le nom de l'attribut.
|
||||
*/
|
||||
public static function getAttrs($dn) {
|
||||
public static function getAttrs($dn, $filter=null) {
|
||||
$infos = ldap_explode_dn($dn,0);
|
||||
if((!$infos)||($infos['count']==0))
|
||||
return;
|
||||
$return=self :: search('(objectClass=*)',$dn);
|
||||
return $return[0]['attrs'];
|
||||
if (!$filter)
|
||||
$filter = '(objectClass=*)';
|
||||
$return = self :: search($filter, $dn);
|
||||
if (is_array($return) && count($return) == 1)
|
||||
return $return[0]['attrs'];
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue