X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=e97472913ae63548089029ed1f66e09e9a10f8f5;hb=88c7097e6f942052991d5e6a190896f8ae1aacee;hp=eb1619ca1cfef566bece5a85e0a93c26c477587a;hpb=e784633d8cc8eb15ae92c6015cf86206ceb84538;p=contagged diff --git a/inc/functions.php b/inc/functions.php index eb1619c..e974729 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -384,6 +384,7 @@ function ldap_queryabooks($filter,$types){ $results = array(); $result1 = array(); $result2 = array(); + $result3 = array(); // public addressbook $sr = @ldap_list($LDAP_CON,$conf['publicbook'], @@ -393,7 +394,7 @@ function ldap_queryabooks($filter,$types){ ldap_free_result($sr); // private addressbook - if(!empty($_SESSION['ldapab']['binddn'])){ + if(!empty($_SESSION['ldapab']['binddn']) && $conf['privatebook']){ $sr = @ldap_list($LDAP_CON,$conf['privatebook']. ','.$_SESSION['ldapab']['binddn'], $filter,$types); @@ -401,8 +402,19 @@ function ldap_queryabooks($filter,$types){ $result2 = ldap_get_binentries($LDAP_CON, $sr); } + // user account entries + if ($conf['displayusertree']) { + $sr = @ldap_list($LDAP_CON,$conf['usertree'], + $filter,$types); + tpl_ldaperror(); + $result3 = ldap_get_binentries($LDAP_CON, $sr); + ldap_free_result($sr); + } + + + // return merged results - return array_merge((array)$result1,(array)$result2); + return array_merge((array)$result1,(array)$result2,(array)$result3); } /**