From: moodler Date: Sun, 30 Jan 2005 09:14:41 +0000 (+0000) Subject: "enrol" field in user_students defaults to $CFG->enrol X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=92318548ce1e44f1958595598c168f9de1475207;p=moodle.git "enrol" field in user_students defaults to $CFG->enrol --- 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;