]> git.mjollnir.org Git - moodle.git/commitdiff
Added some messages in integrity checks to be more explicit.
authorstronk7 <stronk7>
Mon, 10 May 2004 16:02:03 +0000 (16:02 +0000)
committerstronk7 <stronk7>
Mon, 10 May 2004 16:02:03 +0000 (16:02 +0000)
Howard Miller suggested it.

backup/restore_precheck.html

index 9ebcfc9d30749ea026978a320076883d9f1620dc..015e00760cf862e941ce7037fc92a2b33eeb3fd6 100644 (file)
     //Now copy he zip file to dataroot/temp/backup/backup_unique_code
     if ($status) {
         echo "<li>".get_string("copyingzipfile");
-        $status = backup_copy_file($file,$CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file));
+        if (! $status = backup_copy_file($file,$CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file))) {
+            notify("Error copying backup file. Invalid name or bad perms.");
+        }
     }
 
     //Now unzip the file
     if ($status) {
         echo "<li>".get_string("unzippingbackup");
-        $status = restore_unzip ($CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file));
+        if (! $status = restore_unzip ($CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file))) {
+            notify("Error unzipping backup file. Invalid zip file.");
+        }
     }
 
     //Now check for the moodle.xml file
     if ($status) {
         $xml_file  = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
         echo "<li>".get_string("checkingbackup");
-        $status = restore_check_moodle_file ($xml_file);
+        if (! $status = restore_check_moodle_file ($xml_file)) {
+            notify("Error checking backup file. Invalid or corrupted.");
+        }
     }
 
     $info = "";