mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
Merged unenrol fixes from stable MDL-6964 MDL-7123
This commit is contained in:
parent
4e19d85bd9
commit
a6f39157c6
@ -39,20 +39,22 @@
|
||||
}
|
||||
|
||||
if ($confirm and confirm_sesskey()) {
|
||||
|
||||
if ($userid) {
|
||||
if (! role_unassign(0, $userid, 0, $context->id)) {
|
||||
error("An error occurred while trying to unenrol that person.");
|
||||
}
|
||||
|
||||
add_to_log($course->id, 'course', 'unenrol', "view.php?id=$course->id", $userid);
|
||||
redirect($CFG->wwwroot.'/user/index.php?id='.$course->id);
|
||||
|
||||
} else {
|
||||
if (! role_unassign(0, $USER->id, 0, $context->id)) {
|
||||
error("An error occurred while trying to unenrol you.");
|
||||
}
|
||||
add_to_log($course->id, 'course', 'unenrol', "view.php?id=$course->id", $USER->id);
|
||||
|
||||
redirect($CFG->wwwroot);
|
||||
}
|
||||
|
||||
add_to_log($course->id, 'course', 'unenrol', "view.php?id=$course->id", $USER->id);
|
||||
|
||||
redirect($CFG->wwwroot.'/user/index.php?id='.$course->id);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user