]> git.sur5r.net Git - contagged/blobdiff - tags.php
added .htaccess filese to protect inc and similar directories
[contagged] / tags.php
index 443ed67cd8271ff8539ef4263aadfe91fb9a8a0a..b81e50e2e6c08f1ea58e1d0959098337a9bb5ff1 100644 (file)
--- a/tags.php
+++ b/tags.php
@@ -1,7 +1,12 @@
-<?
-  require_once('init.php');
+<?php
+  require_once('inc/init.php');
   ldap_login();
 
+  if ($conf['userlogreq'] && $user == ''){
+    header('Location: login.php');
+    exit();
+  }
+
   //prepare templates
   tpl_std();
   $smarty->assign('tagcloud',tag_cloud());
   function tag_cloud(){
     global $conf;
     global $LDAP_CON;
+    global $FIELDS;
     if(!$conf['extended']) return;
 
-    $result = ldap_queryabooks('(objectClass=contactPerson)','marker');
+    $result = ldap_queryabooks('(objectClass=inetOrgPerson)',$FIELDS['_marker']);
 
     $max = 0;
     $min = 999999999;
     $tags = array();
     foreach ($result as $entry){
-      if(!empty($entry['marker']) && count($entry['marker'])){
-        foreach($entry['marker'] as $marker){
+      if(!empty($entry[$FIELDS['_marker']]) && count($entry[$FIELDS['_marker']])){
+        foreach($entry[$FIELDS['_marker']] as $marker){
           $marker = strtolower($marker);
           if (empty($tags[$marker])) { $tags[$marker]=0; }
           $tags[$marker] += 1;