Fix error when page url is not set

This commit is contained in:
Dmitrii Metelkin 2019-11-16 23:20:22 +11:00
parent 4a18dea34f
commit ac66abbd21

View file

@ -137,7 +137,7 @@ class auth_plugin_userkey extends auth_plugin_base {
* @throws \moodle_exception If something went wrong. * @throws \moodle_exception If something went wrong.
*/ */
public function user_login_userkey() { public function user_login_userkey() {
global $SESSION, $CFG, $PAGE; global $SESSION, $CFG;
$keyvalue = required_param('key', PARAM_ALPHANUM); $keyvalue = required_param('key', PARAM_ALPHANUM);
$wantsurl = optional_param('wantsurl', '', PARAM_URL); $wantsurl = optional_param('wantsurl', '', PARAM_URL);
@ -153,7 +153,7 @@ class auth_plugin_userkey extends auth_plugin_base {
if (isloggedin()) { if (isloggedin()) {
if ($SESSION->userid != $key->userid) { if ($SESSION->userid != $key->userid) {
require_logout(); require_logout();
$this->redirect($PAGE->url); // login url retry $this->user_login_userkey();
} }
} }