MDL-71887 mod_lti: repost when no cookie due to crosssite request

This commit is contained in:
Claude Vervoort
2021-07-07 14:18:23 +08:00
committed by Jake Dallimore
parent 773984295b
commit 89feb325b7
5 changed files with 173 additions and 4 deletions
+13
View File
@@ -24,6 +24,19 @@
require_once(__DIR__ . '/../../config.php');
require_once($CFG->dirroot . '/mod/lti/locallib.php');
global $_POST, $_SERVER;
if (!isloggedin() && empty($_POST['repost'])) {
header_remove("Set-Cookie");
$PAGE->set_pagelayout('popup');
$PAGE->set_context(context_system::instance());
$output = $PAGE->get_renderer('mod_lti');
$page = new \mod_lti\output\repost_crosssite_page($_SERVER['REQUEST_URI'], $_POST);
echo $output->header();
echo $output->render($page);
echo $output->footer();
return;
}
$scope = optional_param('scope', '', PARAM_TEXT);
$responsetype = optional_param('response_type', '', PARAM_TEXT);