Skip to content

Commit

Permalink
MDL-20901 fixed input validationand removed annoying redirect which m…
Browse files Browse the repository at this point in the history
…ust not be clicked during course import
  • Loading branch information
skodak committed Nov 19, 2009
1 parent a8adf25 commit 4d93b20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions backup/restore.php
Expand Up @@ -154,6 +154,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");
Expand All @@ -169,6 +170,7 @@
}
//Unset this for the future
unset($SESSION->cancontinue);
require_sesskey();
include_once("restore_execute.html");
}
print_simple_box_end();
Expand Down
1 change: 1 addition & 0 deletions backup/restore_check.html
Expand Up @@ -355,6 +355,7 @@
$hidden["launch"] = "execute";
$hidden["file"] = $file;
$hidden["id"] = $id;
$hidden["sesskey"] = sesskey();
print_string('longtimewarning','admin');


Expand Down
7 changes: 3 additions & 4 deletions backup/restorelib.php
Expand Up @@ -7804,10 +7804,9 @@ function restore_precheck($id,$file,&$errorstr,$noredirect=false) {
}
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;
Expand Down

0 comments on commit 4d93b20

Please sign in to comment.