getDNAttrValues($request['dn'],null,LDAP_DEREF_NEVER,array($request['attr'])); break; } if (! isset($jpeg_data[$request['attr']][$request['index']])) { if (function_exists('imagecreate')) { $im = imagecreate(160,30); if (is_resource($im)) { header('Content-type: image/png'); # Set the background imagecolorallocatealpha($im,0xFC,0xFC,0xFE,127); $text_color = imagecolorallocate($im,0,0,0); imagestring($im,4,3,5,_('Image not available'),$text_color); imagepng($im); imagedestroy($im); die(); } } # We cant display an error, but we can set a system message, which will be display on the next page render. system_message(array( 'title'=>_('No image available'), 'body'=>sprintf(_('Could not fetch jpeg data from LDAP server for attribute [%s].'),$request['attr']), 'type'=>'warn')); die(); } if (! is_array($jpeg_data[$request['attr']])) { $jpeg_data[$request['attr']] = array($jpeg_data[$request['attr']]); } $obStatus = ob_get_status(); if (isset($obStatus['type']) && $obStatus['type'] && $obStatus['status']) { ob_end_clean(); } header(sprintf('Content-type: %s',$request['type'])); header(sprintf('Content-disposition: inline; filename="%s"',$request['filename'])); echo $jpeg_data[$request['attr']][$request['index']]; die();