]> git.sur5r.net Git - contagged/commitdiff
Make it possible to show/edit user account entries
authorAndy Wettstein <ajw@illinois.edu>
Wed, 3 Dec 2008 12:19:38 +0000 (13:19 +0100)
committerAndy Wettstein <ajw@illinois.edu>
Wed, 3 Dec 2008 12:19:38 +0000 (13:19 +0100)
darcs-hash:20081203121938-18fff-53679b52dc4910e64fa77d2ab420cfe6f4fc50f3.gz

inc/config.php
inc/functions.php

index c03cbc7e5232570b44f4ce26dbccf48df77b90f6..21ad781f7f578dfc168c6d4edd295db9b08739e4 100644 (file)
@@ -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']  = '';
index a5e0631cf46d7dad051abc732773402e9e5364af..e97472913ae63548089029ed1f66e09e9a10f8f5 100644 (file)
@@ -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);
 }
 
 /**