]> git.mjollnir.org Git - moodle.git/commitdiff
Deleting $SESSION structures before starting manual restore.
authorstronk7 <stronk7>
Mon, 10 Apr 2006 18:34:37 +0000 (18:34 +0000)
committerstronk7 <stronk7>
Mon, 10 Apr 2006 18:34:37 +0000 (18:34 +0000)
backup/restore.php
files/index.php

index 16fc52e275529e079b28b471f2db4862181c903a..e7d97368389fa970a375e853de2334632ae2d5ab 100644 (file)
 
     //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;
     }
 
     //Call the form, depending the step we are
 
-
     if (!$launch) {
         include_once("restore_precheck.html");
     } else if ($launch == "form") {
index cef37a0c06e5b45cba7a6e1044a64cf5c7bb3c9b..7e36b89f7fa4f0882c842e3d874637759e531fce 100644 (file)
                 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);