From 1efa27fdbb4b9634596014262231d14da4bd8ebd Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 21 Jul 2003 07:50:59 +0000 Subject: [PATCH] Close loophole for invisible courses by re-enrolment --- lib/moodlelib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b5012eccfa..e5d1ba510a 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -309,6 +309,10 @@ function require_login($courseid=0) { if (! $course = get_record("course", "id", $courseid)) { error("That course doesn't exist"); } + if (!$course->visible) { + print_header(); + notice(get_string("studentnotallowed", "", "$USER->firstname $USER->lastname"), $CFG->wwwroot); + } if ($USER->username == "guest") { switch ($course->guest) { case 0: // Guests not allowed -- 2.39.5