// 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'] = '';
$results = array();
$result1 = array();
$result2 = array();
+ $result3 = array();
// public addressbook
$sr = @ldap_list($LDAP_CON,$conf['publicbook'],
$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);
}
/**