Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More restrictions on enrol/unenrol of meta courses. Thanks to Bug #4057

  • Loading branch information...
commit 498ef90f7b9be57bf261d148a70b72658c9e8dc9 1 parent ace9977
patrickslee authored
View
2  blocks/admin/block_admin.php
@@ -189,7 +189,7 @@ function load_content_for_course() {
$this->content->items[]='<a href="'.$CFG->changepassword.'">'.get_string('changepassword').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
}
- if ($CFG->allowunenroll) {
+ if ($CFG->allowunenroll && !$course->metacourse) {
$this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', $course->shortname).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
}
View
4 course/importstudents.php
@@ -27,8 +27,8 @@
redirect("$CFG->wwwroot/course/student.php?id=$course->id");
}
- if (!isadmin()) {
- error("You must be an admin");
+ if (!isadmin() || !isteacheredit($course->id)) {
+ error("You must be an admin or a teacher of this course");
}
View
2  course/unenrol.php
@@ -24,7 +24,7 @@
error("You must be a teacher with editing rights to do this");
}
- if ($user->id == $USER->id and !$CFG->allowunenroll) {
+ if ($user->id == $USER->id and !$CFG->allowunenroll or $course->metacourse) {
error("You are not allowed to unenroll");
}
Please sign in to comment.
Something went wrong with that request. Please try again.