| 1 |
<?php |
<?php |
| 2 |
// fileserv.module - A module to enable file downloads from an existing |
// fileserv.module - A module to enable file downloads from an existing |
| 3 |
// filesystem - for the Drupal content management system |
// filesystem - for the Drupal content management system |
| 4 |
// $Id: fileserv.module,v 1.46 2004/10/30 02:23:31 matt Exp $ |
// $Id: fileserv.module,v 1.5 2004/10/30 02:39:08 spoopin Exp $ |
| 5 |
|
|
| 6 |
|
|
| 7 |
function fileserv_page() { |
function fileserv_page() { |
| 35 |
fileserv_apply_properties($_POST); |
fileserv_apply_properties($_POST); |
| 36 |
} |
} |
| 37 |
if ($entry_id) { // Looking for a specific file or directory |
if ($entry_id) { // Looking for a specific file or directory |
| 38 |
$clean_id = check_query($entry_id); |
$clean_id = db_escape_string($entry_id); |
| 39 |
$result = db_query("SELECT f_type, deny_role FROM {fileserv_filelist} WHERE entry_id = '{$clean_id}'"); |
$result = db_query("SELECT f_type, deny_role FROM {fileserv_filelist} WHERE entry_id = '{$clean_id}'"); |
| 40 |
if (db_num_rows($result) != '1') { |
if (db_num_rows($result) != '1') { |
| 41 |
fileserv_error_out(); |
fileserv_error_out(); |
| 65 |
} |
} |
| 66 |
break; |
break; |
| 67 |
case 'editprop': |
case 'editprop': |
| 68 |
$clean_ent_id = check_query($entry_id); |
$clean_ent_id = db_escape_string($entry_id); |
| 69 |
$clean_edit_id = check_query($edit_id); |
$clean_edit_id = db_escape_string($edit_id); |
| 70 |
fileserv_edit_properties($clean_ent_id, $clean_edit_id); |
fileserv_edit_properties($clean_ent_id, $clean_edit_id); |
| 71 |
break; |
break; |
| 72 |
case 'runcron': // Update filesystem listings in DB |
case 'runcron': // Update filesystem listings in DB |
| 391 |
|
|
| 392 |
function fileserv_apply_properties($post) { |
function fileserv_apply_properties($post) { |
| 393 |
|
|
| 394 |
$clean_comment = check_query($post['comment']); |
$clean_comment = db_escape_string($post['comment']); |
| 395 |
$clean_id = check_query($post['edit_id']); |
$clean_id = db_escape_string($post['edit_id']); |
| 396 |
unset($post['comment']); |
unset($post['comment']); |
| 397 |
unset($post['edit_id']); |
unset($post['edit_id']); |
| 398 |
// Process permissions stuff |
// Process permissions stuff |
| 639 |
} |
} |
| 640 |
$hash = md5($fq_name); |
$hash = md5($fq_name); |
| 641 |
$l = $hash{0}; |
$l = $hash{0}; |
| 642 |
$name = check_query($array_item); |
$name = db_escape_string($array_item); |
| 643 |
$mtime = filemtime($fq_name); |
$mtime = filemtime($fq_name); |
| 644 |
$parent_dir = check_query($input_dir); |
$parent_dir = db_escape_string($input_dir); |
| 645 |
if (!is_array($hash_array[$l])) { |
if (!is_array($hash_array[$l])) { |
| 646 |
$hash_array[$l] = Array(); |
$hash_array[$l] = Array(); |
| 647 |
} |
} |