mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-47950 course: Adding sesskey confirmation when duplicating activities
This commit is contained in:
parent
0a92904c47
commit
f31d564133
@ -78,7 +78,7 @@ if (!empty($add)) {
|
||||
$returntomod = optional_param('return', 0, PARAM_BOOL);
|
||||
redirect("$CFG->wwwroot/course/modedit.php?update=$update&return=$returntomod&sr=$sectionreturn");
|
||||
|
||||
} else if (!empty($duplicate)) {
|
||||
} else if (!empty($duplicate) and confirm_sesskey()) {
|
||||
$cm = get_coursemodule_from_id('', $duplicate, 0, true, MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
|
||||
|
@ -31,9 +31,11 @@
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
|
||||
$cmid = required_param('cmid', PARAM_INT);
|
||||
$courseid = optional_param('course', PARAM_INT);
|
||||
$courseid = required_param('course', PARAM_INT);
|
||||
$sectionreturn = optional_param('sr', null, PARAM_INT);
|
||||
|
||||
require_sesskey();
|
||||
|
||||
debugging('Please use moodle_url(\'/course/mod.php\', array(\'duplicate\' => $cmid
|
||||
, \'id\' => $courseid, \'sesskey\' => sesskey(), \'sr\' => $sectionreturn)))
|
||||
instead of new moodle_url(\'/course/modduplicate.php\', array(\'cmid\' => $cmid
|
||||
|
Loading…
x
Reference in New Issue
Block a user