xref: /dokuwiki/lib/exe/detail.php (revision 3409ba76d3dce34bc631c6bf42be3bc0e1444323)
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
20$ERROR = false;
21// check image permissions
22$AUTH = auth_quickaclcheck($IMG);
23if($AUTH >= AUTH_READ){
24    // check if image exists
25    $SRC = mediaFN($IMG,$REV);
26    if(!file_exists($SRC)){
27        //doesn't exist!
28        http_status(404);
29        $ERROR = 'File not found';
30    }
31}else{
32    // no auth
33    $ERROR = p_locale_xhtml('denied');
34}
35
36//start output and load template
37header('Content-Type: text/html; charset=utf-8');
38include(template('detail.php'));
39
40