pagelib: MDL-12212 require_login should set $PAGE->cm, if appicable.

This commit is contained in:
tjhunt
2009-07-21 07:02:06 +00:00
parent 41e87d30bc
commit 95d28870a2
+5 -1
View File
@@ -1989,7 +1989,11 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
throw new moodle_exception('invalidcourseid');
}
}
$PAGE->set_course($course);
if ($cm) {
$PAGE->set_cm($cm, $course);
} else {
$PAGE->set_course($course);
}
} else {
// If $PAGE->course, and hence $PAGE->context, have not already been set
// up properly, set them up now.