X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=add970ca8bcb73c58ac51673fedb40c84698e664;hb=0ca5fea0cc893684982894e474a00176853535e6;hp=a5e0631cf46d7dad051abc732773402e9e5364af;hpb=b923ce87e422780c66bc65d048e130e29f72109f;p=contagged diff --git a/inc/functions.php b/inc/functions.php index a5e0631..add970c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -344,7 +344,7 @@ function ldap_store_objectclasses($dn,$classes){ $add['objectClass'] = $set; $r = @ldap_mod_replace($LDAP_CON,$dn,$add); - tpl_ldaperror(); + tpl_ldaperror('store object classes'); /* print '
';
   print_r($set);
@@ -384,9 +384,10 @@ function ldap_queryabooks($filter,$types){
   $results = array();
   $result1 = array();
   $result2 = array();
+  $result3 = array();
 
   // public addressbook
-  $sr      = @ldap_list($LDAP_CON,$conf['publicbook'],
+  $sr      = @ldap_search($LDAP_CON,$conf['publicbook'],
                         $filter,$types);
   tpl_ldaperror();
   $result1 = ldap_get_binentries($LDAP_CON, $sr);
@@ -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);
 }
 
 /**
@@ -507,9 +519,31 @@ function get_fields_from_template($tpl){
             $return[] = $FIELDS[$f];
         }elseif($FIELDS["_$f"]){
             $return[] = $FIELDS["_$f"];
+        }elseif($f = 'markers'){
+            $return[] = 'marker';
         }
     }
     return $return;
 }
 
+function addCoords(&$coords, $entry, $geocoder)
+{
+    $priv = $geocoder->getPrivateCoords($entry);
+    if ($priv !== null) {
+        $priv->address = ''
+            . $entry['givenname'] . ' ' . $entry['name'] . '
' + . str_replace("\n", '
', $entry['homestreet']); + $coords[] = $priv; + } + + $busi = $geocoder->getBusinessCoords($entry); + if ($busi !== null) { + $busi->address = '' . $entry['organization'] . '
' + . $entry['givenname'] . ' ' . $entry['name'] . '

' + . $entry['street'] . '
' + . $entry['zip'] . ' ' . $entry['location']; + $coords[] = $busi; + } +} + ?>