MSFTMPP-268: Check if OIDC user is already migrated

This commit is contained in:
Charles Verge 2015-10-29 11:19:23 -03:00
Родитель fef3bd4908
Коммит 740bf3ee28
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -157,7 +157,9 @@ class authcode extends \auth_oidc\loginflow\base {
return true;
}
if (isloggedin() === true) {
// Check if OIDC user is already migrated.
$tokenrec = $DB->get_record('auth_oidc_token', ['oidcuniqid' => $oidcuniqid]);
if (isloggedin() === true && empty($tokenrec)) {
// If the user is already logged in we can treat this as a "migration" - a user switching to OIDC.
$connectiononly = false;
if (isset($SESSION->auth_oidc_connectiononly)) {
@ -309,4 +311,4 @@ class authcode extends \auth_oidc\loginflow\base {
complete_user_login($user);
return true;
}
}
}