155efc227SAndreas Gohr<?php 2*cbb44eabSAndreas Gohr 3*cbb44eabSAndreas Gohruse dokuwiki\Extension\Event; 4*cbb44eabSAndreas Gohr 5d0a27cb0SAndreas Gohrif(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); 67a24876fSAndreas Gohrdefine('DOKU_MEDIADETAIL',1); 755efc227SAndreas Gohrrequire_once(DOKU_INC.'inc/init.php'); 855efc227SAndreas Gohr 96de3759aSAndreas Gohr$IMG = getID('media'); 10bfd0f597STom N Harris$ID = cleanID($INPUT->str('id')); 114bde2196Slisps$REV = $INPUT->int('rev'); 1255efc227SAndreas Gohr 135381a7eeSElan Ruusamäe// this makes some general info available as well as the info about the 14b6132871SChristopher Smith// "parent" page 15b6132871SChristopher Smith$INFO = array_merge(pageinfo(),mediainfo()); 16ab4d3f3bSGerrit Uitslag 17ab4d3f3bSGerrit Uitslag$tmp = array(); 18*cbb44eabSAndreas GohrEvent::createAndTrigger('DETAIL_STARTED', $tmp); 19b6132871SChristopher Smith 20b6132871SChristopher Smith//close session 21b6132871SChristopher Smithsession_write_close(); 22b6132871SChristopher Smith 2355efc227SAndreas Gohr$ERROR = false; 2455efc227SAndreas Gohr// check image permissions 2555efc227SAndreas Gohr$AUTH = auth_quickaclcheck($IMG); 2655efc227SAndreas Gohrif($AUTH >= AUTH_READ){ 2755efc227SAndreas Gohr // check if image exists 285c2eed9aSlisps $SRC = mediaFN($IMG,$REV); 2979e79377SAndreas Gohr if(!file_exists($SRC)){ 3055efc227SAndreas Gohr //doesn't exist! 319d2e1be6SAndreas Gohr http_status(404); 320b836216SAndreas Gohr $ERROR = 'File not found'; 3355efc227SAndreas Gohr } 3455efc227SAndreas Gohr}else{ 3555efc227SAndreas Gohr // no auth 3655efc227SAndreas Gohr $ERROR = p_locale_xhtml('denied'); 3755efc227SAndreas Gohr} 3855efc227SAndreas Gohr 3955efc227SAndreas Gohr//start output and load template 4055efc227SAndreas Gohrheader('Content-Type: text/html; charset=utf-8'); 415a892029SAndreas Gohrinclude(template('detail.php')); 4255efc227SAndreas Gohr 43