enrol/mnet: mark context as dirty after unenrol
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:12:10 +0000 (07:12 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:12:10 +0000 (07:12 +0000)
So the unenrolment is effective immediately.

enrol/mnet/enrol.php

index 4cffd613de538f837f888e325994b5489da54532..5b6f19212cd4d7b3573a36a7db0eea628dd6e0f7 100644 (file)
@@ -362,7 +362,10 @@ class enrolment_plugin_mnet {
         // Are we a *real* user or the shady MNET Daemon?
         // require_capability('moodle/role:assign', $context, NULL, false);
 
-        if (! role_unassign(0, $userrecord->id, 0, $context->id)) {
+        if (role_unassign(0, $userrecord->id, 0, $context->id)) {
+            // force accessinfo refresh for users visiting this context...
+            mark_context_dirty($context->path);
+        } else {
             error("An error occurred while trying to unenrol that person.");
         }