diff --git a/calendar/event.php b/calendar/event.php index 7031a87d455..eb4ba6db9f9 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -39,9 +39,9 @@ ///////////////////////////////////////////////////////////////////////////// require_once('../config.php'); - require_once('lib.php'); - require_once('../course/lib.php'); - require_once('../mod/forum/lib.php'); + require_once($CFG->dirroot.'/calendar/lib.php'); + require_once($CFG->dirroot.'/course/lib.php'); + require_once($CFG->dirroot.'/mod/forum/lib.php'); require_login(); diff --git a/calendar/preferences.php b/calendar/preferences.php index 194f3f4b632..5a134a3e742 100644 --- a/calendar/preferences.php +++ b/calendar/preferences.php @@ -1,9 +1,8 @@ dirroot.'/calendar/lib.php'); if (isset($SESSION->cal_course_referer)) { if (! $course = get_record("course", "id", $SESSION->cal_course_referer)) { @@ -17,7 +16,7 @@ /// If data submitted, then process and store. - if ($form = data_submitted()) { + if ($form = data_submitted()) { print_header(); foreach ($form as $preference => $value) { switch ($preference) { diff --git a/calendar/set.php b/calendar/set.php index 78d40f5bd86..470bd736396 100644 --- a/calendar/set.php +++ b/calendar/set.php @@ -39,7 +39,7 @@ ///////////////////////////////////////////////////////////////////////////// require_once('../config.php'); - require_once('lib.php'); + require_once($CFG->dirroot.'/calendar/lib.php'); require_variable($_GET['from']); require_variable($_GET['var']); diff --git a/calendar/view.php b/calendar/view.php index eb6042c5867..243eebdf3b5 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -41,8 +41,8 @@ // Display the calendar page. require_once('../config.php'); - require_once('../course/lib.php'); - require_once('lib.php'); + require_once($CFG->dirroot.'/course/lib.php'); + require_once($CFG->dirroot.'/calendar/lib.php'); optional_variable($_GET['view'], 'upcoming'); optional_variable($_GET['course'], 0); @@ -117,7 +117,8 @@ // but NOT for the "main page" course if($SESSION->cal_course_referer > 1 && ($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) { - // If we know about the referring course, show a return link + // If we know about the referring course, show a return link and ALSO require login! + require_login(); $nav = ''.$shortname.' -> '.$nav; } diff --git a/course/view.php b/course/view.php index c945d5431bd..029261194c9 100644 --- a/course/view.php +++ b/course/view.php @@ -2,9 +2,9 @@ // Display the course home page. - require_once("../config.php"); - require_once("lib.php"); - require_once("$CFG->libdir/blocklib.php"); + require_once('../config.php'); + require_once('lib.php'); + require_once($CFG->libdir.'/blocklib.php'); optional_variable($id); optional_variable($name); @@ -25,7 +25,7 @@ require_login($course->id); - require_once('../calendar/lib.php'); /// This is after login because it needs $USER + require_once($CFG->dirroot.'/calendar/lib.php'); /// This is after login because it needs $USER add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");