MDL-23856 fixed invalid section restriction test

This commit is contained in:
Petr Skoda
2010-08-18 22:29:40 +00:00
parent 7b2e259c8c
commit 172ab48445
+5 -1
View File
@@ -494,7 +494,11 @@ if ($component === 'blog') {
$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