wwwroot/login/index.php"); } else { if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to)) && !has_capability('moodle/site:import', get_context_instance(CONTEXT_COURSE, $to))) { print_error("cannotuseadminadminorteacher", '', "$CFG->wwwroot/login/index.php"); } } } } else { if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM))) { print_error("cannotuseadmin", '', "$CFG->wwwroot/login/index.php"); } } //Check site if (!$site = get_site()) { print_error("siteisnotdefined", 'debug'); } $errorstr = ''; if (!empty($SESSION->restore->importing)) { define('RESTORE_SILENTLY',true); } $status = restore_precheck($id,$file,$errorstr); if (!$status) { print_error("pleasereport"); } ?>