Skip to content

Commit

Permalink
MDL-23856 fixed invalid section restriction test
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 18, 2010
1 parent 7b2e259 commit 172ab48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pluginfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,11 @@

$sectionid = (int)array_shift($args);

if ($course->numsections < $sectionid) {
if (!$section = $DB->get_record('course_sections', array('id'=>$sectionid, 'course'=>$course->id))) {
send_file_not_found();
}

if ($course->numsections < $section->section) {
if (!has_capability('moodle/course:update', $context)) {
// disable access to invisible sections if can not edit course
// this is going to break some ugly hacks, but is necessary
Expand Down

0 comments on commit 172ab48

Please sign in to comment.