Skip to content
Snippets Groups Projects
Commit b80bedd6 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

MEDIA_SENDFILE event added

This new event wraps around the sendFile function in lib/exe/fetch.php and
allows intercepting mediafile downloads.

darcs-hash:20080623172020-7ad00-c71293c9ebbbce7559e4b34e878d364a555ebfa2.gz
parent 7ba41511
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,8 @@
exit;
}
$ORIG = $FILE;
//handle image resizing/cropping
if((substr($MIME,0,5) == 'image') && $WIDTH){
if($HEIGHT){
......@@ -75,7 +77,18 @@
}
// finally send the file to the client
sendFile($FILE,$MIME,$CACHE);
$data = array('file' => $FILE,
'mime' => $MIME,
'cache' => $CACHE,
'orig' => $ORIG,
'ext' => $EXT,
'width' => $WIDTH,
'height' => $HEIGHT);
$evt = new Doku_Event('MEDIA_SENDFILE', $data);
if ($evt->advise_before()) {
sendFile($data['file'],$data['mime'],$data['cache']);
}
/* ------------------------------------------------------------------------ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment