2 require_once('inc/init.php');
5 if ($conf['userlogreq'] && !isset($_SESSION['ldapab']['username'])){
6 header("HTTP/1.0 401 Access Denied");
7 echo '<h1>Access Denied</h1>';
11 $dn = $_REQUEST['dn'];
13 $sr = ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)',array($FIELDS['photo']));
14 if(!ldap_count_entries($LDAP_CON,$sr)){
15 header("HTTP/1.0 404 Not Found");
16 echo '<h1>Not Found</h1>';
19 $result = ldap_get_binentries($LDAP_CON, $sr);
22 header("Content-type: image/jpeg");
23 print $entry[$FIELDS['photo']][0];