file grademethod.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50...
[moodle.git] / backup / restore_precheck.html
blob02e820044691027a4377300f370bb28819c84262
1 <?php // $Id$
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
8 if (!isset($file)) {
9 error ("File not specified");
12 //Check login
13 require_login();
15 //Check admin
16 if (!empty($id)) {
17 if (!isteacheredit($id)) {
18 if (empty($to)) {
19 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
20 } else {
21 if (!isteacheredit($to)) {
22 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
26 } else {
27 if (!isadmin()) {
28 error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
32 //Check site
33 if (!$site = get_site()) {
34 error("Site not found!");
37 $status = restore_precheck($id,$file,!empty($SESSION->restore->importing));
39 if (!$status) {
40 error("An error occured");