From f54c4273daec8cbb7e9d9a8eaee06de54029723f Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Thu, 19 Nov 2009 18:48:34 +0000 Subject: [PATCH] MDL-20901 fixed input validationand removed annoying redirect which must not be clicked during course import --- backup/restore.php | 2 ++ backup/restore_check.html | 1 + backup/restorelib.php | 7 +++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backup/restore.php b/backup/restore.php index 482eb5ba95..bbc424f548 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -165,6 +165,7 @@ if (!empty($SESSION->restore->importing)) { // set up all the config stuff and skip asking the user about it. restore_setup_for_check($SESSION->restore,$backup_unique_code); + require_sesskey(); include_once("restore_execute.html"); } else { include_once("restore_form.html"); @@ -180,6 +181,7 @@ } //Unset this for the future unset($SESSION->cancontinue); + require_sesskey(); include_once("restore_execute.html"); } echo $OUTPUT->box_end(); diff --git a/backup/restore_check.html b/backup/restore_check.html index f361f4b087..98e5edfa6a 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -359,6 +359,7 @@ $hidden["launch"] = "execute"; $hidden["file"] = $file; $hidden["id"] = $id; + $hidden["sesskey"] = sesskey(); print_string('longtimewarning','admin'); diff --git a/backup/restorelib.php b/backup/restorelib.php index f319f45e24..e4df732aca 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -8021,10 +8021,9 @@ define('RESTORE_GROUPS_GROUPINGS', 3); } else { if (empty($noredirect)) { - // in 2.0 we must not print "Continue" redirect link here, because ppl click on it and the execution gets interrupted on next page!!! - // imo RESTORE_SILENTLY is an ugly hack :-P - $sillystr = get_string('donotclickcontinue'); - redirect($CFG->wwwroot.'/backup/restore.php?backup_unique_code='.$backup_unique_code.'&launch=form&file='.$file.'&id='.$id, $sillystr, 0); + print_continue($CFG->wwwroot.'/backup/restore.php?backup_unique_code='.$backup_unique_code.'&launch=form&file='.$file.'&id='.$id.'&sesskey='.sesskey()); + print_footer(); + die; } else { return $backup_unique_code; -- 2.39.5