* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['allowframembedding'] = 'In order to avoid problems embedding this site, please enable the \'Allow frame embedding\' setting in Admin > Security > HTTP security.';
$string['enrolenddate'] = 'End date';
$string['enrolenddate_help'] = 'If enabled, users can access until this date only.';
$string['enrolenddateerror'] = 'Enrolment end date cannot be earlier than start date';
$string['enrolmentnotstarted'] = 'Enrolment has not started.';
$string['enrolstartdate'] = 'Start date';
$string['enrolstartdate_help'] = 'If enabled, users can access from this date onward only.';
+$string['framembeddingnotenabled'] = 'The site you are connecting to does not have frame embedding enabled. To access the resource please click on the link below.';
$string['globalsharedsecret'] = 'Global shared secret';
$string['gradesync'] = 'Grade synchronisation';
$string['gradesync_help'] = 'This determines if we want grade synchronisation to occur.';
$string['notoolsprovided'] = 'No tools provided';
$string['lti:config'] = 'Configure LTI enrol instances';
$string['lti:unenrol'] = 'Unenrol users from the course';
+$string['opentool'] = 'Open tool';
$string['pluginname'] = 'Shared external tool';
$string['pluginname_desc'] = 'The shared external tool plugin allows externals users to access a course or an activity via a unique link - this requires the LTI authentication plugin to be enabled.';
$string['remotesystem'] = 'Remote system';
$settings->add(new admin_setting_heading('enrol_lti_user_default_values',
get_string('userdefaultvalues', 'enrol_lti'), ''));
+ if (empty($CFG->allowframembedding)) {
+ $notify = new \core\output\notification(get_string('allowframembedding', 'enrol_lti'),
+ \core\output\notification::NOTIFY_WARNING);
+ $settings->add(new admin_setting_heading('enrol_lti_enable_embedding', '', $OUTPUT->render($notify)));
+ }
+
$choices = array(0 => get_string('emaildisplayno'),
1 => get_string('emaildisplayyes'),
2 => get_string('emaildisplaycourse'));
// Finalise the user log in.
complete_user_login($user);
- // All done, redirect the user to where they want to go.
- redirect($urltogo);
+ if (empty($CFG->allowframembedding)) {
+ // Provide an alternative link.
+ $stropentool = get_string('opentool', 'enrol_lti');
+ echo html_writer::tag('p', get_string('framembeddingnotenabled', 'enrol_lti'));
+ echo html_writer::link($urltogo, $stropentool, array('target' => '_blank'));
+ } else {
+ // All done, redirect the user to where they want to go.
+ redirect($urltogo);
+ }
} else {
echo $ltirequest->message;
}