diff --git a/login/confirm.php b/login/confirm.php index 04314e44387..b46dec26048 100644 --- a/login/confirm.php +++ b/login/confirm.php @@ -24,7 +24,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -require('../config.php'); +require(__DIR__ . '/../config.php'); +require(__DIR__ . '/lib.php'); require_once($CFG->libdir . '/authlib.php'); $data = optional_param('data', '', PARAM_RAW); // Formatted as: secret/username @@ -61,7 +62,7 @@ if (!empty($data) || (!empty($p) && !empty($s))) { echo $OUTPUT->header(); echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter'); echo "

".get_string("alreadyconfirmed")."

\n"; - echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses')); + echo $OUTPUT->single_button(core_login_get_return_url(), get_string('courses')); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); exit; @@ -78,16 +79,6 @@ if (!empty($data) || (!empty($p) && !empty($s))) { complete_user_login($user); \core\session\manager::apply_concurrent_login_limit($user->id, session_id()); - - // Check where to go, $redirect has a higher preference. - if (empty($redirect) and !empty($SESSION->wantsurl) ) { - $redirect = $SESSION->wantsurl; - unset($SESSION->wantsurl); - } - - if (!empty($redirect)) { - redirect($redirect); - } } $PAGE->navbar->add(get_string("confirmed")); @@ -97,7 +88,7 @@ if (!empty($data) || (!empty($p) && !empty($s))) { echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter'); echo "

".get_string("thanks").", ". fullname($USER) . "

\n"; echo "

".get_string("confirmed")."

\n"; - echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses')); + echo $OUTPUT->single_button(core_login_get_return_url(), get_string('continue')); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); exit;