Browse files

Fix to logic for require_login so guest access to courses works.

  • Loading branch information...
1 parent b7678df commit 794bdefb1c511c2aaa6eee153a87be20577fdfed ikawhero committed Apr 7, 2006
Showing with 10 additions and 7 deletions.
  1. +10 −7 lib/moodlelib.php
View
17 lib/moodlelib.php
@@ -1417,14 +1417,17 @@ function require_login($courseid=0, $autologinguest=true, $cm=null) {
redirect($CFG->wwwroot.'/course/view.php?id='.$cm->course, get_string('activityiscurrentlyhidden'));
}
return; // user is a member of this course.
- if (! $course = get_record('course', 'id', $courseid)) {
- error('That course doesn\'t exist');
- }
- if (!$course->visible) {
- print_header();
- notice(get_string('coursehidden'), $CFG->wwwroot .'/');
- }
}
+
+ if (! $course = get_record('course', 'id', $courseid)) {
+ error('That course doesn\'t exist');
+ }
+
+ if (!$course->visible) {
+ print_header();
+ notice(get_string('coursehidden'), $CFG->wwwroot .'/');
+ }
+
if ($USER->username == 'guest') {
switch ($course->guest) {
case 0: // Guests not allowed

0 comments on commit 794bdef

Please sign in to comment.