mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-58220-master-fix3' of http://github.com/damyon/moodle
This commit is contained in:
commit
c3345f32f0
1 changed files with 6 additions and 19 deletions
|
@ -518,28 +518,15 @@ class auth extends \auth_plugin_base {
|
||||||
$message = get_string('emailconfirmsent', '', $userinfo['email']);
|
$message = get_string('emailconfirmsent', '', $userinfo['email']);
|
||||||
$this->print_confirm_required($emailconfirm, $message);
|
$this->print_confirm_required($emailconfirm, $message);
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we got to here - we must have found a real user account that is confirmed.
|
// We used to call authenticate_user - but that won't work if the current user has a different default authentication
|
||||||
$this->set_static_user_info($userinfo);
|
// method. Since we now ALWAYS link a login - if we get to here we can directly allow the user in.
|
||||||
$user = authenticate_user_login($userinfo['username'], '');
|
$user = (object) $userinfo;
|
||||||
|
complete_user_login($user);
|
||||||
if ($user) {
|
$this->update_picture($user);
|
||||||
complete_user_login($user);
|
redirect($redirecturl);
|
||||||
$this->update_picture($user);
|
|
||||||
redirect($redirecturl);
|
|
||||||
}
|
|
||||||
// Trigger login failed event.
|
|
||||||
$failurereason = AUTH_LOGIN_FAILED;
|
|
||||||
$event = \core\event\user_login_failed::create(['other' => ['username' => $userinfo['username'],
|
|
||||||
'reason' => $failurereason]]);
|
|
||||||
$event->trigger();
|
|
||||||
|
|
||||||
$errormsg = get_string('notloggedindebug', 'auth_oauth2', get_string('loginerror_authenticationfailed', 'auth_oauth2'));
|
|
||||||
$SESSION->loginerrormsg = $errormsg;
|
|
||||||
redirect(new moodle_url($CFG->httpswwwroot . '/login/index.php'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue