Merge branch 'MDL-69910-calendar-protectusername' of https://github.com/brendanheywood/moodle

This commit is contained in:
Jake Dallimore 2020-10-12 10:05:28 +08:00
commit 29da421a85

View file

@ -18,7 +18,7 @@ if (empty($CFG->enablecalendarexport)) {
$checkuserid = !empty($userid) && $user = $DB->get_record('user', array('id' => $userid), 'id,password');
//allowing for fallback check of old url - MDL-27542
$checkusername = !empty($username) && $user = $DB->get_record('user', array('username' => $username), 'id,password');
if (!$checkuserid && !$checkusername) {
if ((!$checkuserid && !$checkusername) || !$user) {
//No such user
die('Invalid authentication');
}