| 1 |
<?php |
<?php |
| 2 |
// $Id: filerequest.module,v 1.4 2006/07/03 14:03:54 elmuerte Exp $ |
// $Id: filerequest.module,v 1.4.2.1 2006/07/03 14:12:08 elmuerte Exp $ |
| 3 |
|
|
| 4 |
function filerequest_help($section) { |
function filerequest_help($section) { |
| 5 |
switch ($section) { |
switch ($section) { |
| 92 |
define("__DRUPAL_BASE_DIR", dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR); |
define("__DRUPAL_BASE_DIR", dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR); |
| 93 |
require_once("downloadhandler.php"); |
require_once("downloadhandler.php"); |
| 94 |
|
|
| 95 |
$config["filename"] = $_GET['file']; |
$args = func_get_args(); |
| 96 |
|
$config["filename"] = implode('/', $args); |
| 97 |
$config["filereq_antileech_enabled"] = variable_get('filereq_antileech_enabled', true); |
$config["filereq_antileech_enabled"] = variable_get('filereq_antileech_enabled', true); |
| 98 |
$config["filereq_antileech_regex"] = variable_get('filereq_antileech_regex', preg_quote($_SERVER["HTTP_HOST"])); |
$config["filereq_antileech_regex"] = variable_get('filereq_antileech_regex', preg_quote($_SERVER["HTTP_HOST"])); |
| 99 |
$config["filereq_antileech_image_mode"] = variable_get('filereq_antileech_image_mode', 0); |
$config["filereq_antileech_image_mode"] = variable_get('filereq_antileech_image_mode', 0); |
| 116 |
if (file_exists($config["filename"])) { |
if (file_exists($config["filename"])) { |
| 117 |
$list = module_list(); |
$list = module_list(); |
| 118 |
foreach ($list as $module) { |
foreach ($list as $module) { |
| 119 |
$headers = module_invoke($module, 'file_download', $_GET['file']); |
$headers = module_invoke_all($module, 'file_download', $_GET['file']); |
| 120 |
if (in_array(-1, $headers)) { |
if (in_array(-1, $headers)) { |
| 121 |
return drupal_access_denied(); |
return drupal_access_denied(); |
| 122 |
} |
} |
| 123 |
elseif (is_array($headers)) { |
else if (count($headers)) { |
| 124 |
// make sure no caching headers are set |
// make sure no caching headers are set |
| 125 |
header("Cache-Control:"); |
header("Cache-Control:"); |
| 126 |
header("Pragma:"); |
header("Pragma:"); |