]> git.mjollnir.org Git - moodle.git/commitdiff
FIxed a bug where $context had not been defined in enrol_into_course
authormoodler <moodler>
Wed, 20 Sep 2006 02:19:08 +0000 (02:19 +0000)
committermoodler <moodler>
Wed, 20 Sep 2006 02:19:08 +0000 (02:19 +0000)
lib/accesslib.php

index c9495b74c8839ea1e9e56f57a5a9c1591155d6d7..dfb7374a41d729cb56d54cd6e34d6fd31d414ae7 100755 (executable)
@@ -1534,6 +1534,9 @@ function enrol_into_course($course, $user, $enrol) {
     }
 
     if ($role = get_default_course_role($course)) {
+
+        $context = get_context_instance(CONTEXT_COURSE, $course->id);
+
         if (role_assign($role->id, $user->id, 0, $context->id, $timestart, $timeend, 0, $enrol)) {
             return false;
         }