summaryrefslogtreecommitdiff
path: root/platform/www/lib/exe/detail.php
diff options
context:
space:
mode:
Diffstat (limited to 'platform/www/lib/exe/detail.php')
-rw-r--r--platform/www/lib/exe/detail.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/platform/www/lib/exe/detail.php b/platform/www/lib/exe/detail.php
new file mode 100644
index 0000000..a6cffa7
--- /dev/null
+++ b/platform/www/lib/exe/detail.php
@@ -0,0 +1,42 @@
+<?php
+
+use dokuwiki\Extension\Event;
+
+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();
+Event::createAndTrigger('DETAIL_STARTED', $tmp);
+
+//close session
+session_write_close();
+
+$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'));
+