about summary refs log tree commit diff stats
path: root/wiki/lib/exe/detail.php
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2018-12-03 19:22:25 -0500
committerahriman <ahriman@falte.red>2018-12-03 19:22:25 -0500
commit0ae8cbf5c0b1a198b963490985b7738392ebcb97 (patch)
treeb2c77ae72c6b717e2b97492065196ac5ffb2d9e2 /wiki/lib/exe/detail.php
parentf57f6cc5a2d159f90168d292437dc4bd8cd7f934 (diff)
downloadsite-0ae8cbf5c0b1a198b963490985b7738392ebcb97.tar.gz
installed dokuwiki, added to navbar, updated news
Diffstat (limited to 'wiki/lib/exe/detail.php')
-rw-r--r--wiki/lib/exe/detail.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/wiki/lib/exe/detail.php b/wiki/lib/exe/detail.php
new file mode 100644
index 0000000..ec1a9b8
--- /dev/null
+++ b/wiki/lib/exe/detail.php
@@ -0,0 +1,53 @@
+<?php
+if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
+define('DOKU_MEDIADETAIL',1);
+require_once(DOKU_INC.'inc/init.php');
+
+$IMG  = getID('media');
+$ID   = cleanID($INPUT->str('id'));
+$REV  = $INPUT->int('rev');
+
+// this makes some general info available as well as the info about the
+// "parent" page
+$INFO = array_merge(pageinfo(),mediainfo());
+
+$tmp = array();
+trigger_event('DETAIL_STARTED', $tmp);
+
+//close session
+session_write_close();
+
+if($conf['allowdebug'] && $INPUT->has('debug')){
+    print '<pre>';
+    foreach(explode(' ','basedir userewrite baseurl useslash') as $x){
+        print '$'."conf['$x'] = '".$conf[$x]."';\n";
+    }
+    foreach(explode(' ','DOCUMENT_ROOT HTTP_HOST SCRIPT_FILENAME PHP_SELF '.
+                'REQUEST_URI SCRIPT_NAME PATH_INFO PATH_TRANSLATED') as $x){
+        print '$'."_SERVER['$x'] = '".$_SERVER[$x]."';\n";
+    }
+    print "getID('media'): ".getID('media')."\n";
+    print "getID('media',false): ".getID('media',false)."\n";
+    print '</pre>';
+}
+
+$ERROR = false;
+// check image permissions
+$AUTH = auth_quickaclcheck($IMG);
+if($AUTH >= AUTH_READ){
+    // check if image exists
+    $SRC = mediaFN($IMG,$REV); 
+    if(!file_exists($SRC)){
+        //doesn't exist!
+        http_status(404);
+        $ERROR = 'File not found';
+    }
+}else{
+    // no auth
+    $ERROR = p_locale_xhtml('denied');
+}
+
+//start output and load template
+header('Content-Type: text/html; charset=utf-8');
+include(template('detail.php'));
+