Enrol script ignores users created with the course generator. Fixes #112
authorFrederic Massart <fred@moodle.com>
Wed, 28 Jan 2015 04:21:24 +0000 (12:21 +0800)
committerFrederic Massart <fred@moodle.com>
Wed, 28 Jan 2015 04:21:24 +0000 (12:21 +0800)
mdk/scripts/enrol.php

index 6b60998..2803fe3 100644 (file)
@@ -52,7 +52,8 @@ $sql = "SELECT id, username
          WHERE (username LIKE 's%'
             OR username LIKE 't%'
             OR username LIKE 'm%')
-           AND deleted = 0";
+           AND deleted = 0
+           AND username NOT LIKE 'tool_generator_%'";
 $users = $DB->get_recordset_sql($sql, array());
 $courses = $DB->get_records_select('course', 'id > ?', array(1), '', 'id, startdate');
 $plugin = new enrol_manual_plugin();