xref: /dokuwiki/lib/exe/detail.php (revision e6e54bbf489558efff6d36ca016a745267d79f7d)
155efc227SAndreas Gohr<?php
2d0a27cb0SAndreas Gohrif(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
37a24876fSAndreas Gohrdefine('DOKU_MEDIADETAIL',1);
455efc227SAndreas Gohrrequire_once(DOKU_INC.'inc/init.php');
555efc227SAndreas Gohr//close session
655efc227SAndreas Gohrsession_write_close();
755efc227SAndreas Gohr
86de3759aSAndreas Gohr$IMG  = getID('media');
96de3759aSAndreas Gohr$ID   = cleanID($_REQUEST['id']);
1055efc227SAndreas Gohr
11f42d1c75SAndreas Gohrif($conf['allowdebug'] && $_REQUEST['debug']){
1242905504SAndreas Gohr    print '<pre>';
1342905504SAndreas Gohr    foreach(explode(' ','basedir userewrite baseurl useslash') as $x){
1442905504SAndreas Gohr        print '$'."conf['$x'] = '".$conf[$x]."';\n";
1542905504SAndreas Gohr    }
1642905504SAndreas Gohr    foreach(explode(' ','DOCUMENT_ROOT HTTP_HOST SCRIPT_FILENAME PHP_SELF '.
1742905504SAndreas Gohr                'REQUEST_URI SCRIPT_NAME PATH_INFO PATH_TRANSLATED') as $x){
1842905504SAndreas Gohr        print '$'."_SERVER['$x'] = '".$_SERVER[$x]."';\n";
1942905504SAndreas Gohr    }
2042905504SAndreas Gohr    print "getID('media'): ".getID('media')."\n";
2142905504SAndreas Gohr    print "getID('media',false): ".getID('media',false)."\n";
2242905504SAndreas Gohr    print '</pre>';
2342905504SAndreas Gohr}
2442905504SAndreas Gohr
2555efc227SAndreas Gohr$ERROR = false;
2655efc227SAndreas Gohr// check image permissions
2755efc227SAndreas Gohr$AUTH = auth_quickaclcheck($IMG);
2855efc227SAndreas Gohrif($AUTH >= AUTH_READ){
2955efc227SAndreas Gohr    // check if image exists
3055efc227SAndreas Gohr    $SRC = mediaFN($IMG);
31d8186216SBen Coburn    if(!@file_exists($SRC)){
3255efc227SAndreas Gohr        //doesn't exist!
3355efc227SAndreas Gohr
3455efc227SAndreas Gohr    }
3555efc227SAndreas Gohr}else{
3655efc227SAndreas Gohr    // no auth
3755efc227SAndreas Gohr    $ERROR = p_locale_xhtml('denied');
3855efc227SAndreas Gohr}
3955efc227SAndreas Gohr
40*e6e54bbfSAndreas Gohr// this makes some general infos available as well as the info about the
41*e6e54bbfSAndreas Gohr// "parent" page
42*e6e54bbfSAndreas Gohr$INFO = pageinfo();
43*e6e54bbfSAndreas Gohr
4455efc227SAndreas Gohr//start output and load template
4555efc227SAndreas Gohrheader('Content-Type: text/html; charset=utf-8');
465a892029SAndreas Gohrinclude(template('detail.php'));
4755efc227SAndreas Gohr
48