/[drupal]/contributions/modules/filerequest/filerequest.module
ViewVC logotype

Diff of /contributions/modules/filerequest/filerequest.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4.2.1, Mon Jul 3 14:12:08 2006 UTC revision 1.4.2.2, Mon Jul 10 17:05:33 2006 UTC
# Line 1  Line 1 
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) {
# Line 92  function _filerequest_download() { Line 92  function _filerequest_download() {
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);
# Line 115  function _filerequest_download() { Line 116  function _filerequest_download() {
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:");

Legend:
Removed from v.1.4.2.1  
changed lines
  Added in v.1.4.2.2

  ViewVC Help
Powered by ViewVC 1.1.2