mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-58220 oauth2: Don't login as deleted users
Also prevent sesskey error on first page of new logins.
This commit is contained in:
parent
7f15866006
commit
512e681a3b
@ -76,7 +76,15 @@ class api {
|
||||
'issuerid' => $issuer->get('id'),
|
||||
'username' => $username
|
||||
];
|
||||
return linked_login::get_record($params);
|
||||
$result = linked_login::get_record($params);
|
||||
|
||||
if ($result) {
|
||||
$user = \core_user::get_user($result->get('userid'));
|
||||
if (!empty($user) && !$user->deleted) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@
|
||||
require_once('../../config.php');
|
||||
|
||||
$issuerid = required_param('id', PARAM_INT);
|
||||
$wantsurl = new moodle_url(optional_param('wantsurl', '/', PARAM_URL));
|
||||
$wantsurl = new moodle_url(optional_param('wantsurl', '', PARAM_URL));
|
||||
|
||||
require_sesskey();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user