Skip to content

Commit

Permalink
fix for MDL-6599 - problem with hiding of resource when $CFG->prevent…
Browse files Browse the repository at this point in the history
…accesstohiddenfiles enabled
  • Loading branch information
skodak committed Sep 25, 2006
1 parent dcd8e58 commit 0cd482e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion file.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@
// warning: it may break backwards compatibility
if ((!empty($CFG->preventaccesstohiddenfiles))
and (count($args) >= 2)
and (!(strtolower($args[1]) == 'moddata' and strtolower($args[2]) != 'resource')) // do not block files from other modules!
and (!has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE, $course->id)))) {

$reference = ltrim($relativepath, "/{$args[0]}/");
$rargs = $args;
array_shift($rargs);
$reference = implode('/', $rargs);

$sql = "SELECT COUNT(r.id) " .
"FROM {$CFG->prefix}resource r, " .
Expand Down

0 comments on commit 0cd482e

Please sign in to comment.