Some more additions to use the new enrolment architecture.

This commit is contained in:
moodler 2004-06-26 09:51:13 +00:00
parent 04f47a89a1
commit 146bbb8f2d
2 changed files with 30 additions and 10 deletions

View file

@ -23,6 +23,27 @@
$enrol = new enrolment_plugin();
/// Refreshing enrolment data in the USER session
$enrol->get_student_courses($USER);
$enrol->get_teacher_courses($USER);
/// Double check just in case they are actually enrolled already
/// This might occur if they were enrolled during this session
if ( $USER->student[$course->id] or $USER->teacher[$course->id] ) {
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
/// Check the submitted enrollment key if there is one
if ($form = data_submitted()) {