]> git.sur5r.net Git - contagged/blobdiff - img.php
Remove magic_quotes function
[contagged] / img.php
diff --git a/img.php b/img.php
index 3cdd23dc7d23ace64fb5adbaaf0f74442c5527d8..087ff2da69462cbda39e858f43f4b96d8e8c28bf 100644 (file)
--- a/img.php
+++ b/img.php
@@ -2,10 +2,18 @@
 require_once('inc/init.php');
 ldap_login();
 
+if ($conf['userlogreq'] && !isset($_SESSION['ldapab']['username'])){
+  header("HTTP/1.0 401 Access Denied");
+  echo '<h1>Access Denied</h1>';
+  exit();
+}
+
 $dn = $_REQUEST['dn'];
 
 $sr = ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)',array($FIELDS['photo']));
 if(!ldap_count_entries($LDAP_CON,$sr)){
+  header("HTTP/1.0 404 Not Found");
+  echo '<h1>Not Found</h1>';
   exit;
 }
 $result = ldap_get_binentries($LDAP_CON, $sr);