1<?php 2if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); 3define('DOKU_MEDIADETAIL',1); 4require_once(DOKU_INC.'inc/init.php'); 5 6$IMG = getID('media'); 7$ID = cleanID($INPUT->str('id')); 8$REV = $INPUT->int('rev'); 9 10// this makes some general info available as well as the info about the 11// "parent" page 12$INFO = array_merge(pageinfo(),mediainfo()); 13 14$tmp = array(); 15trigger_event('DETAIL_STARTED', $tmp); 16 17//close session 18session_write_close(); 19 20if($conf['allowdebug'] && $INPUT->has('debug')){ 21 print '<pre>'; 22 foreach(explode(' ','basedir userewrite baseurl useslash') as $x){ 23 print '$'."conf['$x'] = '".$conf[$x]."';\n"; 24 } 25 foreach(explode(' ','DOCUMENT_ROOT HTTP_HOST SCRIPT_FILENAME PHP_SELF '. 26 'REQUEST_URI SCRIPT_NAME PATH_INFO PATH_TRANSLATED') as $x){ 27 print '$'."_SERVER['$x'] = '".$_SERVER[$x]."';\n"; 28 } 29 print "getID('media'): ".getID('media')."\n"; 30 print "getID('media',false): ".getID('media',false)."\n"; 31 print '</pre>'; 32} 33 34$ERROR = false; 35// check image permissions 36$AUTH = auth_quickaclcheck($IMG); 37if($AUTH >= AUTH_READ){ 38 // check if image exists 39 $SRC = mediaFN($IMG,$REV); 40 if(!file_exists($SRC)){ 41 //doesn't exist! 42 http_status(404); 43 $ERROR = 'File not found'; 44 } 45}else{ 46 // no auth 47 $ERROR = p_locale_xhtml('denied'); 48} 49 50//start output and load template 51header('Content-Type: text/html; charset=utf-8'); 52include(template('detail.php')); 53 54