Merged unenrol fixes from stable MDL-6964 MDL-7123

This commit is contained in:
moodler 2006-10-23 03:12:37 +00:00
parent 4e19d85bd9
commit a6f39157c6

View File

@ -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);
}