2 //This page copies th zip to the temp directory,
3 //unzip it, check that it is a valid backup file
4 //inform about its contents and fill all the necesary
5 //variables to continue with the restore.
7 //Checks we have the file variable
9 error ("File not specified");
17 if (!isteacheredit($id)) {
19 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
21 if (!isteacheredit($to)) {
22 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
28 error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
33 if (!$site = get_site()) {
34 error("Site not found!");
37 $status = restore_precheck($id,$file,!empty($SESSION->restore
->importing
));
40 error("An error occured");