From 63693fd835e3b4d8a70b6231f58a531d9395fe1b Mon Sep 17 00:00:00 2001 From: ethem Date: Thu, 26 Oct 2006 14:44:53 +0000 Subject: [PATCH] I found a new function: user_has_role_assignment(). Merged from MOODLE_17_STABLE. --- enrol/authorize/uploadcsv.php | 3 +-- enrol/authorize/version.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/enrol/authorize/uploadcsv.php b/enrol/authorize/uploadcsv.php index 1dcdeef978..5b7b1bb8f7 100644 --- a/enrol/authorize/uploadcsv.php +++ b/enrol/authorize/uploadcsv.php @@ -172,8 +172,7 @@ function authorize_process_csv($filename) // If user wasn't enrolled, enrol now. Ignore otherwise. Because admin user might submit this file again. if ($role = get_default_course_role($course)) { - $ra = get_record('role_assignments', 'roleid', $role->id, 'contextid', $coursecontext->id, 'userid', $user->id); - if (empty($ra)) { // Not enrolled, so enrol + if (! user_has_role_assignment($user->id, $role->id, $coursecontext->id)) { $timestart = $timeend = 0; if ($course->enrolperiod) { $timestart = time(); diff --git a/enrol/authorize/version.php b/enrol/authorize/version.php index 9aa012f225..d5f970544b 100755 --- a/enrol/authorize/version.php +++ b/enrol/authorize/version.php @@ -1,6 +1,6 @@ version = 2006101700; -$plugin->requires = 2006091700; +$plugin->requires = 2006100401; ?> -- 2.39.5