MDL-33876 skip deleted users in enrol_database sync

This commit is contained in:
Petr Škoda
2012-07-04 04:17:20 +02:00
committed by Eloy Lafuente (stronk7)
parent 8e12fdea29
commit 90048d3cba
+2 -1
View File
@@ -410,8 +410,9 @@ class enrol_database_plugin extends enrol_plugin {
$sql = $this->db_get_sql($table, array($coursefield=>$course->mapping), $sqlfields);
if ($rs = $extdb->Execute($sql)) {
if (!$rs->EOF) {
$usersearch = array('deleted' => 0);
if ($localuserfield === 'username') {
$usersearch = array('mnethostid'=>$CFG->mnet_localhost_id, 'deleted' =>0);
$usersearch['mnethostid'] = $CFG->mnet_localhost_id;
}
while ($fields = $rs->FetchRow()) {
$fields = array_change_key_case($fields, CASE_LOWER);