Reordered key checks

This commit is contained in:
Andrew Hancox 2017-12-12 11:53:21 +00:00
parent 55b614e284
commit eea400f30f

View file

@ -122,11 +122,11 @@ class core_userkey_manager implements userkey_manager_interface {
print_error('expiredkey');
}
$this->validate_ip_address($key);
if (!$user = $DB->get_record('user', array('id' => $key->userid))) {
print_error('invaliduserid');
}
$this->validate_ip_address($key);
return $key;
}