Deleting $SESSION structures before starting manual restore.

This commit is contained in:
stronk7 2006-04-10 18:34:37 +00:00
parent 8847a82e25
commit 6917949483
2 changed files with 22 additions and 3 deletions

View File

@ -15,14 +15,34 @@
//Optional
$id = optional_param( 'id' );
$file = optional_param( 'file' );;
$file = optional_param( 'file' );
$cancel = optional_param( 'cancel' );
$launch = optional_param( 'launch' );
$to = optional_param( 'to' );
$method = optional_param( 'method' );
//Check login
require_login();
/// With method=manual, we come from the FileManager so we delete all the backup/restore/import session structures
if ($method == 'manual') {
if (isset($SESSION->course_header)) {
unset ($SESSION->course_header);
}
if (isset($SESSION->info)) {
unset ($SESSION->info);
}
if (isset($SESSION->backupprefs)) {
unset ($SESSION->backupprefs);
}
if (isset($SESSION->restore)) {
unset ($SESSION->restore);
}
if (isset($SESSION->import_preferences)) {
unset ($SESSION->import_preferences);
}
}
if (!$to && isset($SESSION->restore->restoreto) && isset($SESSION->restore->importing) && isset($SESSION->restore->course_id)) {
$to = $SESSION->restore->course_id;
}
@ -116,7 +136,6 @@
//Call the form, depending the step we are
if (!$launch) {
include_once("restore_precheck.html");
} else if ($launch == "form") {

View File

@ -571,7 +571,7 @@
echo "<p align=\"center\">".get_string("areyousuretorestorethisinfo")."</p>";
$restore_path = "$CFG->wwwroot/backup/restore.php";
notice_yesno (get_string("areyousuretorestorethis"),
$restore_path."?id=".$id."&amp;file=".cleardoubleslashes($id.$wdir."/".$file),
$restore_path."?id=".$id."&amp;file=".cleardoubleslashes($id.$wdir."/".$file)."&amp;method=manual",
"index.php?id=$id&amp;wdir=$wdir&amp;action=cancel");
} else {
displaydir($wdir);