From: moodler Date: Mon, 23 Oct 2006 03:12:37 +0000 (+0000) Subject: Merged unenrol fixes from stable MDL-6964 MDL-7123 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a6f39157c6f1a7a64ca1b413763502d8cf792b0b;p=moodle.git Merged unenrol fixes from stable MDL-6964 MDL-7123 --- diff --git a/course/unenrol.php b/course/unenrol.php index ba15e4545f..e007e88cc3 100644 --- a/course/unenrol.php +++ b/course/unenrol.php @@ -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); + add_to_log($course->id, 'course', 'unenrol', "view.php?id=$course->id", $USER->id); - redirect($CFG->wwwroot.'/user/index.php?id='.$course->id); + redirect($CFG->wwwroot); + } }