mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +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
30d1832f45
commit
63b4929729
1 changed files with 14 additions and 6 deletions
|
@ -530,11 +530,15 @@ class quizaccess_seb extends quiz_access_rule_base {
|
||||||
* @return string A link to launch Safe Exam Browser.
|
* @return string A link to launch Safe Exam Browser.
|
||||||
*/
|
*/
|
||||||
private function get_launch_seb_button() : string {
|
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());
|
$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.
|
* @return string A link to launch Safe Exam Browser.
|
||||||
*/
|
*/
|
||||||
private function get_download_config_button() : string {
|
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());
|
$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…
Add table
Add a link
Reference in a new issue