MDL-63887 auth_ldap: fix unclean exit from sync when users not found

We should return, not exit, and we should clean up before we do.
This commit is contained in:
Jake Dallimore 2018-12-12 08:53:35 +08:00
parent 84e8e17820
commit 39ac02f424

View File

@ -753,7 +753,9 @@ class auth_plugin_ldap extends auth_plugin_base {
$count = $DB->count_records_sql('SELECT COUNT(username) AS count, 1 FROM {tmp_extuser}');
if ($count < 1) {
print_string('didntgetusersfromldap', 'auth_ldap');
exit;
$dbman->drop_table($table);
$this->ldap_close();
return false;
} else {
print_string('gotcountrecordsfromldap', 'auth_ldap', $count);
}