Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Block normal users to gain access to meta courses

  • Loading branch information...
commit df7f761f53a7178a922dee47e1e104b8c2838cb2 1 parent 25340ce
patrickslee authored
Showing with 7 additions and 0 deletions.
  1. +6 −0 course/enrol.php
  2. +1 −0  lang/en/moodle.php
View
6 course/enrol.php
@@ -19,6 +19,12 @@
error("Could not find a site!");
}
+/// Check if the course is a meta course
+ if ($course->metacourse) {
+ print_header_simple();
+ notice(get_string('coursenotaccessible'), $CFG->wwwroot);
+ }
+
check_for_restricted_user($USER->username);
$enrol = new enrolment_plugin();
View
1  lang/en/moodle.php
@@ -206,6 +206,7 @@
$string['courseformats'] = 'Course formats';
$string['coursegrades'] = 'Course grades';
$string['courseinfo'] = 'Course info';
+$string['coursenotaccessible'] = 'This course does not allow public access';
$string['courserestore'] = 'Course restore';
$string['courses'] = 'Courses';
$string['coursestaught'] = 'Courses I have taught';
Please sign in to comment.
Something went wrong with that request. Please try again.