MDL-33876 skip deleted users in enrol_database sync

This commit is contained in:
Petr Škoda 2012-06-30 08:42:16 +02:00
parent 6be7840ce6
commit 0004317f79

View file

@ -445,8 +445,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);