mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Deleting $SESSION structures before starting manual restore.
This commit is contained in:
parent
8847a82e25
commit
6917949483
@ -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") {
|
||||
|
@ -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."&file=".cleardoubleslashes($id.$wdir."/".$file),
|
||||
$restore_path."?id=".$id."&file=".cleardoubleslashes($id.$wdir."/".$file)."&method=manual",
|
||||
"index.php?id=$id&wdir=$wdir&action=cancel");
|
||||
} else {
|
||||
displaydir($wdir);
|
||||
|
Loading…
x
Reference in New Issue
Block a user