]> git.mjollnir.org Git - moodle.git/commitdiff
"enrol" field in user_students defaults to $CFG->enrol
authormoodler <moodler>
Sun, 30 Jan 2005 09:14:41 +0000 (09:14 +0000)
committermoodler <moodler>
Sun, 30 Jan 2005 09:14:41 +0000 (09:14 +0000)
lib/moodlelib.php

index 4668b4502693a26e574d9933dd5c5b108832eaf1..360a8fe56d7832670eb71086fdc733058e4b5397 100644 (file)
@@ -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;