From e76806d154863dcaae69a8a509d7d5c8c4e4b40c Mon Sep 17 00:00:00 2001 From: Andy Wettstein Date: Wed, 3 Dec 2008 13:19:38 +0100 Subject: [PATCH] Make it possible to show/edit user account entries darcs-hash:20081203121938-18fff-53679b52dc4910e64fa77d2ab420cfe6f4fc50f3.gz --- inc/config.php | 3 +++ inc/functions.php | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/inc/config.php b/inc/config.php index c03cbc7..21ad781 100644 --- a/inc/config.php +++ b/inc/config.php @@ -21,6 +21,9 @@ // How to match users? %u is replaced by the given login $conf['userfilter'] = '(&(uid=%u)(objectClass=posixAccount))'; + // Show the users as contacts, too? + $conf['displayusertree'] = 0; + // Use these values to bind to the ldap directory when not logged in (leave blank for anonymous bind) $conf['anonbinddn'] = ''; $conf['anonbindpw'] = ''; diff --git a/inc/functions.php b/inc/functions.php index a5e0631..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'], @@ -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); } /** -- 2.39.5