diff --git a/calendar/export_execute.php b/calendar/export_execute.php index a06f3286cc6..9f44a6e2241 100644 --- a/calendar/export_execute.php +++ b/calendar/export_execute.php @@ -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'); }