MDL-58220 oauth2: Fix account linking

The username passed to the confirm account link request is the oauth username,
which may be different to the moodle username so can't be used to look up the user record.
This commit is contained in:
Damyon Wiese 2017-04-06 10:41:46 +08:00
parent b8094f8a18
commit 0eb4c06645

View File

@ -40,8 +40,8 @@ if ($confirmed) {
// The user has confirmed successfully, let's log them in.
if (!$user = get_complete_user_data('username', $username)) {
print_error('cannotfinduser', '', '', s($username));
if (!$user = get_complete_user_data('id', $userid)) {
print_error('cannotfinduser', '', '', $userid);
}
if (!$user->suspended) {