diff --git a/index.php b/index.php index 6c9014cd212..1eb3cc077fd 100644 --- a/index.php +++ b/index.php @@ -13,6 +13,7 @@ define('BLOCK_R_MAX_WIDTH', 210); require_once('config.php'); + require_once($CFG->dirroot .'/course/lib.php'); require_once($CFG->dirroot .'/lib/blocklib.php'); if (empty($SITE)) { @@ -72,8 +73,6 @@ /// Print Section if ($SITE->numsections > 0) { - require_once($CFG->dirroot .'/course/lib.php'); - if (!$section = get_record('course_sections', 'course', $SITE->id, 'section', 1)) { delete_records('course_sections', 'course', $SITE->id, 'section', 1); // Just in case $section->course = $SITE->id; @@ -148,8 +147,6 @@ case FRONTPAGECOURSELIST: case FRONTPAGECATEGORYNAMES: - require_once($CFG->dirroot .'/course/lib.php'); - if (isset($USER->id) and !isset($USER->admin)) { print_heading_block(get_string('mycourses')); print_spacer(8,1);