Skip to content
Permalink
Browse files

Interactive enrolment/unenrolments: make sure we unset mycourses

  • Loading branch information...
martinlanghoff
martinlanghoff committed Sep 19, 2007
1 parent 55e68c2 commit 57770b87d09a50aa6050ebaed1faa87b8ca8f3be
Showing with 6 additions and 0 deletions.
  1. +2 −0 course/unenrol.php
  2. +4 −0 enrol/manual/enrol.php
@@ -58,6 +58,8 @@
// force accessinfo refresh for users visiting this context...
mark_context_dirty($context->path);
// force a refresh of mycourses
unset($USER->mycourses);
add_to_log($course->id, 'course', 'unenrol', "view.php?id=$course->id", $USER->id);
redirect($CFG->wwwroot);
@@ -80,6 +80,8 @@ function print_entry($course) {
if (!enrol_into_course($course, $USER, 'manual')) {
print_error('couldnotassignrole');
}
// force a refresh of mycourses
unset($USER->mycourses);
if (!empty($SESSION->wantsurl)) {
$destination = $SESSION->wantsurl;
@@ -152,6 +154,8 @@ function check_entry($form, $course) {
} else { /// Update or add new enrolment
if (enrol_into_course($course, $USER, 'manual')) {
// force a refresh of mycourses
unset($USER->mycourses);
if ($groupid !== false) {
if (!groups_add_member($groupid, $USER->id)) {
print_error('couldnotassigngroup');

0 comments on commit 57770b8

Please sign in to comment.
You can’t perform that action at this time.