Skip to content

Commit

Permalink
"enrol" field in user_students defaults to $CFG->enrol
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 30, 2005
1 parent cabe3b1 commit 9231854
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 9231854

Please sign in to comment.