]> git.sur5r.net Git - contagged/blobdiff - template.php
more redesign and code cleanup
[contagged] / template.php
index 03be9a9449b94fe1f6595599bb8840e85febcd41..c5e850e68e945fb8cee1f672b65a9d365e7542c3 100644 (file)
@@ -43,8 +43,8 @@ function tpl_entry($in){
   foreach($RFIELDS as $key => $name){
     if(empty($in[$key])) continue;
 
-    // keep arrays for starred fields
-    if($name{0} == '*'){
+    // keep arrays for multi fields
+    if($name{0} == '_'){
         $name  = substr($name,1);
         if(is_array($in[$key])){
             $out[$name] = $in[$key];
@@ -152,17 +152,7 @@ function tpl_orgs(){
   global $FIELDS;
 
   $orgs = array();
-
-  $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=inetOrgPerson",array($FIELDS['organization']));
-  $result1 = ldap_get_binentries($LDAP_CON, $sr);
-  //check users private addressbook
-  if(!empty($_SESSION['ldapab']['binddn'])){
-    $sr = @ldap_list($LDAP_CON,
-                    $conf['privatebook'].','.$_SESSION['ldapab']['binddn'],
-                    "ObjectClass=inetOrgPerson",array($FIELDS['organization']));
-    $result2 = ldap_get_binentries($LDAP_CON, $sr);
-  }
-  $result = array_merge((array)$result1,(array)$result2);
+  $result = ldap_queryabooks("ObjectClass=inetOrgPerson",array($FIELDS['organization']));
 
   if(count($result)){
     foreach ($result as $entry){