MDL-19269 Deleted internal auth users - handling is buggy; credit Martin Langhoff

This commit is contained in:
skodak 2009-09-26 20:17:57 +00:00
parent 64521d31ac
commit 6d7fa5d8d8

View File

@ -3493,14 +3493,15 @@ function authenticate_user_login($username, $password) {
error_log('[client '.getremoteaddr()."] $CFG->wwwroot Disabled Login: $username ".$_SERVER['HTTP_USER_AGENT']); error_log('[client '.getremoteaddr()."] $CFG->wwwroot Disabled Login: $username ".$_SERVER['HTTP_USER_AGENT']);
return false; return false;
} }
if (!empty($user->deleted)) {
add_to_log(0, 'login', 'error', 'index.php', $username);
error_log('[client '.getremoteaddr()."] $CFG->wwwroot Deleted Login: $username ".$_SERVER['HTTP_USER_AGENT']);
return false;
}
$auths = array($auth); $auths = array($auth);
} else { } else {
// check if there's a deleted record (cheaply)
if ($DB->get_field('user', 'id', array('username'=>$username, 'deleted'=>1))) {
error_log('[client '.$_SERVER['REMOTE_ADDR']."] $CFG->wwwroot Deleted Login: $username ".$_SERVER['HTTP_USER_AGENT']);
return false;
}
$auths = $authsenabled; $auths = $authsenabled;
$user = new object(); $user = new object();
$user->id = 0; // User does not exist $user->id = 0; // User does not exist