Skip to content

Commit

Permalink
MDL-34101 use current mnethostide when verifying if user deleted
Browse files Browse the repository at this point in the history
authenticate_user_login() is supposed to work with local accounts only,
mnet accounts must be ignored.
  • Loading branch information
skodak committed Jul 6, 2012
1 parent 2cbdaa7 commit 13951f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/moodlelib.php
Expand Up @@ -4037,8 +4037,8 @@ function authenticate_user_login($username, $password) {
$auths = array($auth);

} else {
// check if there's a deleted record (cheaply)
if ($DB->get_field('user', 'id', array('username'=>$username, 'deleted'=>1))) {
// Check if there's a deleted record (cheaply), this should not happen because we mangle usernames in delete_user().
if ($DB->get_field('user', 'id', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id, 'deleted'=>1))) {
error_log('[client '.getremoteaddr()."] $CFG->wwwroot Deleted Login: $username ".$_SERVER['HTTP_USER_AGENT']);
return false;
}
Expand Down

0 comments on commit 13951f0

Please sign in to comment.