mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-75326 h5p: require sesskey to toggle library enabled state.
This commit is contained in:
parent
896e126a66
commit
b40ab6987d
2 changed files with 4 additions and 0 deletions
|
@ -92,11 +92,13 @@ class libraries implements renderable, templatable {
|
|||
$version->toggleenabledurl = new moodle_url('/h5p/libraries.php', [
|
||||
'id' => $version->id,
|
||||
'action' => 'disable',
|
||||
'sesskey' => sesskey(),
|
||||
]);
|
||||
} else {
|
||||
$version->toggleenabledurl = new moodle_url('/h5p/libraries.php', [
|
||||
'id' => $version->id,
|
||||
'action' => 'enable',
|
||||
'sesskey' => sesskey(),
|
||||
]);
|
||||
}
|
||||
$installed[] = $version;
|
||||
|
|
|
@ -66,6 +66,8 @@ if ($deletelibrary) {
|
|||
}
|
||||
|
||||
if (!is_null($action)) {
|
||||
require_sesskey();
|
||||
|
||||
if ($action == 'enable' || $action == 'disable') {
|
||||
// If action is enable or disable, library id is required too.
|
||||
$libraryid = required_param('id', PARAM_INT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue