From 92318548ce1e44f1958595598c168f9de1475207 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 30 Jan 2005 09:14:41 +0000 Subject: [PATCH] "enrol" field in user_students defaults to $CFG->enrol --- lib/moodlelib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 4668b45026..360a8fe56d 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1829,7 +1829,7 @@ function authenticate_user_login($username, $password) { * @return boolean * @todo Finish documenting this function */ -function enrol_student($userid, $courseid, $timestart=0, $timeend=0, $enrol='manual') { +function enrol_student($userid, $courseid, $timestart=0, $timeend=0, $enrol='') { global $CFG; @@ -1845,6 +1845,10 @@ function enrol_student($userid, $courseid, $timestart=0, $timeend=0, $enrol='man enrol_student($userid, $parent->parent_course,$timestart,$timeend,$enrol); } } + + if (empty($enrol)) { + $enrol = $CFG->enrol; // Default current method + } if ($student = get_record('user_students', 'userid', $userid, 'course', $courseid)) { $student->timestart = $timestart; $student->timeend = $timeend; -- 2.39.5