diff --git a/enrol/flatfile/lib.php b/enrol/flatfile/lib.php index 4add14e4b253a..e0117b97feb90 100644 --- a/enrol/flatfile/lib.php +++ b/enrol/flatfile/lib.php @@ -311,8 +311,8 @@ protected function process_file(progress_trace $trace) { } $roleid = $rolemap[$fields[1]]; - if (empty($fields[2]) or !$user = $DB->get_record("user", array("idnumber"=>$fields[2]))) { - $trace->output("Unknown user idnumber in field 3 - ignoring line $line", 1); + if (empty($fields[2]) or !$user = $DB->get_record("user", array("idnumber"=>$fields[2], 'deleted'=>0))) { + $trace->output("Unknown user idnumber or deleted user in field 3 - ignoring line $line", 1); continue; }