Skip to content

Commit

Permalink
CourseID is now mandatory on file.php
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 7, 2004
1 parent b2e0d6b commit b988c62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions file.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@

$courseid = (integer)$args[0];

$course = get_record("course", "id", $courseid);
if (!$course = get_record("course", "id", $courseid)) { // Course ID must be specified
error("Invalid course ID");
}

if ($course->category) {
require_login($courseid);
} else if ($CFG->forcelogin) {
require_login();
}

// it's OK to get here if no course was specified

$pathname = "$CFG->dataroot$pathinfo";
if ($pathargs = explode("?",$pathname)) {
$pathname = $pathargs[0]; // Only keep what's before the '?'
Expand Down

0 comments on commit b988c62

Please sign in to comment.