mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-71187 quizaccess_seb: Change "Launch Safe Exam Browser" to a href.
In order to allow for correct seb:// or sebs:// calls without browser warnings of insecure links, it is not possible to send a get request with an attached cmid parameter to the unknown seb:// or sebs:// URL via a form button. We've got to use a <a href> link outside a form to circumvent browsers warning of an insecure link and call Safe Exam Browser correctly.
This commit is contained in:
parent
1c9837a557
commit
21503ed5e6
@ -530,11 +530,15 @@ class quizaccess_seb extends quiz_access_rule_base {
|
||||
* @return string A link to launch Safe Exam Browser.
|
||||
*/
|
||||
private function get_launch_seb_button() : string {
|
||||
global $OUTPUT;
|
||||
|
||||
// Rendering as a href and not as button in a form to circumvent browser warnings for sending to URL with unknown protocol.
|
||||
$seblink = \quizaccess_seb\link_generator::get_link($this->quiz->cmid, true, is_https());
|
||||
|
||||
return $OUTPUT->single_button($seblink, get_string('seblinkbutton', 'quizaccess_seb'), 'get');
|
||||
$buttonlink = html_writer::start_tag('div', array('class' => 'singlebutton'));
|
||||
$buttonlink .= html_writer::link($seblink, get_string('seblinkbutton', 'quizaccess_seb'),
|
||||
['class' => 'btn btn-secondary', 'title' => get_string('seblinkbutton', 'quizaccess_seb')]);
|
||||
$buttonlink .= html_writer::end_tag('div');
|
||||
|
||||
return $buttonlink;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -543,11 +547,15 @@ class quizaccess_seb extends quiz_access_rule_base {
|
||||
* @return string A link to launch Safe Exam Browser.
|
||||
*/
|
||||
private function get_download_config_button() : string {
|
||||
global $OUTPUT;
|
||||
|
||||
// Rendering as a href and not as button in a form to circumvent browser warnings for sending to URL with unknown protocol.
|
||||
$httplink = \quizaccess_seb\link_generator::get_link($this->quiz->cmid, false, is_https());
|
||||
|
||||
return $OUTPUT->single_button($httplink, get_string('httplinkbutton', 'quizaccess_seb'), 'get');
|
||||
$buttonlink = html_writer::start_tag('div', array('class' => 'singlebutton'));
|
||||
$buttonlink .= html_writer::link($httplink, get_string('httplinkbutton', 'quizaccess_seb'),
|
||||
['class' => 'btn btn-secondary', 'title' => get_string('httplinkbutton', 'quizaccess_seb')]);
|
||||
$buttonlink .= html_writer::end_tag('div');
|
||||
|
||||
return $buttonlink;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user