diff --git a/mod/lti/return.php b/mod/lti/return.php index 4c231fef65d..0446d406ea6 100644 --- a/mod/lti/return.php +++ b/mod/lti/return.php @@ -31,6 +31,7 @@ $courseid = required_param('course', PARAM_INT); $instanceid = optional_param('instanceid', 0, PARAM_INT); $errormsg = optional_param('lti_errormsg', '', PARAM_RAW); +$msg = optional_param('lti_msg', '', PARAM_RAW); $unsigned = optional_param('unsigned', '0', PARAM_INT); $launchcontainer = optional_param('launch_container', LTI_LAUNCH_CONTAINER_WINDOW, PARAM_INT); @@ -47,7 +48,7 @@ if (!empty($instanceid)) { require_login($course); -if (!empty($errormsg)) { +if (!empty($errormsg) || !empty($msg)) { $url = new moodle_url('/mod/lti/return.php', array('course' => $courseid)); $PAGE->set_url($url); @@ -66,7 +67,9 @@ if (!empty($errormsg)) { if (!empty($lti) and !empty($context)) { echo $OUTPUT->heading(format_string($lti->name, true, array('context' => $context))); } +} +if (!empty($errormsg)) { echo get_string('lti_launch_error', 'lti'); echo htmlspecialchars($errormsg); @@ -90,6 +93,12 @@ if (!empty($errormsg)) { } echo $OUTPUT->footer(); +} else if (!empty($msg)) { + + echo htmlspecialchars($msg); + + echo $OUTPUT->footer(); + } else { $courseurl = new moodle_url('/course/view.php', array('id' => $courseid)); $url = $courseurl->out();