]> git.sur5r.net Git - contagged/blobdiff - ajax.php
Support for national letter tabs
[contagged] / ajax.php
index 997eba1e49e2c3ce9399ac53cf16bbe6cd498ab7..2ccb52f95af89019853ffd8e092b80e8ac40d7b0 100644 (file)
--- a/ajax.php
+++ b/ajax.php
@@ -1,13 +1,13 @@
-<?
-require_once('init.php');
+<?php
+require_once('inc/init.php');
 ldap_login();
 
+if ($conf['userlogreq'] && $user == ''){
+  header("HTTP/1.1 401 Access Denied");
+  echo '<h1>Access Denied</h1>';
+  exit();
+}
 
-/*
-echo '<bla><[!CDATA[';
-print_r($_REQUEST);
-echo ']]></bla>';
-*/
 
 $FIELD = preg_replace('/entry\[/','',$_REQUEST['field']);
 $FIELD = preg_replace('/\W+/','',$FIELD);
@@ -46,7 +46,7 @@ function ajax_addnote($dn,$note){
   ldap_modify($LDAP_CON,$dn,$entry);
 
 
-  require_once(dirname(__FILE__).'/smarty/plugins/modifier.noteparser.php');
+  require_once(dirname(__FILE__).'/inc/smarty/plugins/modifier.noteparser.php');
   print smarty_modifier_noteparser($note);
 }
 
@@ -95,9 +95,9 @@ function ajax_loadtags($dn,$type='plain'){
   $entry  = $result[0];
 
   if($type == 'plain'){
-    echo join(', ',$entry[$FIELDS['_marker']]);
+    echo join(', ',(array) $entry[$FIELDS['_marker']]);
   }else{
-    foreach ($entry[$FIELDS['_marker']] as $tag){
+    foreach ((array) $entry[$FIELDS['_marker']] as $tag){
       echo '<a href="index.php?marker=';
       echo rawurlencode($tag);
       echo '" class="tag">';