/// OK, we have all the data, now present it to the user
- if ($download == "xls") {
+ if ($download == "xls" and confirm_sesskey()) {
require_once("../lib/excel/Worksheet.php");
require_once("../lib/excel/Workbook.php");
exit;
- } else if ($download == "txt") {
+ } else if ($download == "txt" and confirm_sesskey()) {
/// Print header to force download
echo "<td>";
$options["id"] = "$course->id";
$options["download"] = "xls";
+ $options["sesskey"] = $USER->sesskey;
print_single_button("grades.php", $options, get_string("downloadexcel"));
echo "<td>";
$options["download"] = "txt";
+ $options["sesskey"] = $USER->sesskey;
print_single_button("grades.php", $options, get_string("downloadtext"));
echo "</table>";