2008-08-12 13:17:34 +00:00
|
|
|
<?php
|
|
|
|
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
|
|
|
require_once($CFG->libdir . '/portfoliolib.php');
|
|
|
|
require_once($CFG->libdir . '/file/stored_file.php');
|
|
|
|
require_once($CFG->libdir . '/filelib.php');
|
|
|
|
|
|
|
|
$id = required_param('id', PARAM_INT);
|
|
|
|
|
|
|
|
$exporter = portfolio_exporter::rewaken_object($id);
|
|
|
|
|
|
|
|
if ($exporter->get('instance')->is_push()) {
|
2008-08-19 14:20:32 +00:00
|
|
|
throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio');
|
2008-08-12 13:17:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!$exporter->get('instance')->verify_file_request_params(array_merge($_GET, $_POST))) {
|
2008-08-19 14:20:32 +00:00
|
|
|
throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio');
|
2008-08-12 13:17:34 +00:00
|
|
|
}
|
|
|
|
|
2008-08-29 12:36:56 +00:00
|
|
|
$exporter->get('instance')->send_file();
|
2008-08-12 13:17:34 +00:00
|
|
|
$exporter->process_stage_cleanup(true);
|
2008-08-29 12:36:56 +00:00
|
|
|
exit;
|
2008-08-12 13:17:34 +00:00
|
|
|
?>
|