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