From: Andy Wettstein Date: Wed, 3 Dec 2008 12:19:38 +0000 (+0100) Subject: Make it possible to show/edit user account entries X-Git-Tag: 0.7.1~15 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e76806d154863dcaae69a8a509d7d5c8c4e4b40c;p=contagged Make it possible to show/edit user account entries darcs-hash:20081203121938-18fff-53679b52dc4910e64fa77d2ab420cfe6f4fc50f3.gz --- 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); } /**