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

Merged from MOODLE_15_STABLE
This commit is contained in:
patrickslee 2005-11-15 21:55:13 +00:00
parent 84d8c4086e
commit 9edf8e04e5
3 changed files with 4 additions and 4 deletions

View File

@ -200,7 +200,7 @@ class block_admin extends block_list {
$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 File

@ -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 File

@ -25,7 +25,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");
}