mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
More restrictions on enrol/unenrol of meta courses. Thanks to Bug #4057
Merged from MOODLE_15_STABLE
This commit is contained in:
parent
84d8c4086e
commit
9edf8e04e5
@ -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="" />';
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user