From: Frederic Massart Date: Wed, 4 Jun 2014 08:12:40 +0000 (+0800) Subject: Do not try to enrol deleted users X-Git-Tag: v1.3~29 X-Git-Url: http://git.cameron1729.xyz/?a=commitdiff_plain;h=8e45587982f44b6490e813918b2111cb48abd158;p=mdk.git Do not try to enrol deleted users --- diff --git a/scripts/enrol.php b/scripts/enrol.php index 4c24912..6b60998 100644 --- a/scripts/enrol.php +++ b/scripts/enrol.php @@ -49,9 +49,10 @@ function mdk_get_role($username) { $sql = "SELECT id, username FROM {user} - WHERE username LIKE 's%' + WHERE (username LIKE 's%' OR username LIKE 't%' - OR username LIKE 'm%'"; + OR username LIKE 'm%') + AND deleted = 0"; $users = $DB->get_recordset_sql($sql, array()); $courses = $DB->get_records_select('course', 'id > ?', array(1), '', 'id, startdate'); $plugin = new enrol_manual_plugin(); diff --git a/scripts/test.php b/scripts/test.php new file mode 100644 index 0000000..c71fb3e --- /dev/null +++ b/scripts/test.php @@ -0,0 +1,2 @@ +