| 1 |
<?php |
<?php |
| 2 |
// $Id: filerequest.module,v 1.4.2.1 2006/07/03 14:12:08 elmuerte Exp $ |
// $Id: filerequest.module,v 1.4.2.2 2006/07/10 17:05:33 elmuerte Exp $ |
| 3 |
|
|
| 4 |
function filerequest_help($section) { |
function filerequest_help($section) { |
| 5 |
switch ($section) { |
switch ($section) { |
| 121 |
return drupal_access_denied(); |
return drupal_access_denied(); |
| 122 |
} |
} |
| 123 |
else if (count($headers)) { |
else if (count($headers)) { |
| 124 |
|
// set custom headers |
| 125 |
|
$forceMime = ''; |
| 126 |
|
foreach ($headers as $header) { |
| 127 |
|
header($header); |
| 128 |
|
if (preg_match('#^Content-Type: (.*)$#i', $header, $match)) { |
| 129 |
|
$forceMime = $match[1]; |
| 130 |
|
} |
| 131 |
|
} |
| 132 |
// make sure no caching headers are set |
// make sure no caching headers are set |
| 133 |
header("Cache-Control:"); |
header("Cache-Control:"); |
| 134 |
header("Pragma:"); |
header("Pragma:"); |
| 135 |
header("Expires:"); |
header("Expires:"); |
| 136 |
__fr_process_download($config["filename"], preg_match("#(\?|&)download(&|$)#", $_SERVER["REQUEST_URI"]), $config["watermark"]); |
// unset other headers we (might) set |
| 137 |
|
header("Content-Range:"); |
| 138 |
|
header("Content-Length:"); |
| 139 |
|
header("Content-Type:"); |
| 140 |
|
header("Last-Modified:"); |
| 141 |
|
header("Content-Disposition:"); |
| 142 |
|
__fr_process_download($config["filename"], preg_match("#(\?|&)download(&|$)#", $_SERVER["REQUEST_URI"]), $config["watermark"], $forceMime); |
| 143 |
exit(); |
exit(); |
| 144 |
} |
} |
| 145 |
} |
} |