mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Some more additions to use the new enrolment architecture.
This commit is contained in:
parent
04f47a89a1
commit
146bbb8f2d
2 changed files with 30 additions and 10 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue