MDL-47950 course: Adding sesskey confirmation when duplicating activities
[moodle.git] / course / modduplicate.php
index ae75273..81eefa6 100644 (file)
 require_once(dirname(dirname(__FILE__)) . '/config.php');
 
 $cmid           = required_param('cmid', PARAM_INT);
 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);
 
 $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
 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