Permalink
Browse files

I found a new function: user_has_role_assignment()

  • Loading branch information...
1 parent c03b88f commit ca36c9581f1223437fe1a59e0bf94106b766ae16 ethem committed Oct 26, 2006
Showing with 2 additions and 3 deletions.
  1. +1 −2 enrol/authorize/uploadcsv.php
  2. +1 −1 enrol/authorize/version.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();
@@ -1,6 +1,6 @@
<?php // $Id$
$plugin->version = 2006101700;
-$plugin->requires = 2006091700;
+$plugin->requires = 2006100401;
?>

0 comments on commit ca36c95

Please sign in to comment.