]> git.mjollnir.org Git - moodle.git/commitdiff
Interactive enrolment/unenrolments: make sure we unset mycourses
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:17:23 +0000 (07:17 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:17:23 +0000 (07:17 +0000)
course/unenrol.php
enrol/manual/enrol.php

index 302ebb1188c1554527860e60d2e3375f3888d8f2..ea3c925a25987dbcef640cc294735332dbb8c47d 100644 (file)
@@ -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);
index ea3d09b16688ce9269e91aeddd9411388675c950..49fb53194428a521327de22c4d19a601c4cd9131 100644 (file)
@@ -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');