Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug that prevented guest access to courses that are not enrollable

  • Loading branch information...
commit 572badbdcec78dc0964af50d7e6c3ad3181bbda8 1 parent bcde80f
gustav_delius authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 course/enrol.php
View
5 course/enrol.php
@@ -85,10 +85,11 @@
notice(get_string('enrolmentnointernal'), "$CFG->wwwroot/index.php");
}
- if (!$course->enrollable ||
+ if (!$loginasguest and ($USER->username != 'guest') and(
+ !$course->enrollable ||
($course->enrollable == 2 && $course->enrolstartdate > 0 && $course->enrolstartdate > time()) ||
($course->enrollable == 2 && $course->enrolenddate > 0 && $course->enrolenddate <= time())
- ) {
+ )) {
print_header($course->shortname, $course->fullname, $course->shortname );
notice(get_string('notenrollable'), "$CFG->wwwroot/index.php");
}
Please sign in to comment.
Something went wrong with that request. Please try again.