]> git.sur5r.net Git - contagged/blobdiff - inc/functions.php
Slovak Translation added
[contagged] / inc / functions.php
index eb1619ca1cfef566bece5a85e0a93c26c477587a..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'],
@@ -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);
 }
 
 /**