MDL-16505 Removing qtype_datasetdependent questiontype
[moodle.git] / portfolio / file.php
CommitLineData
d96a1acc 1<?php
2require_once(dirname(dirname(__FILE__)) . '/config.php');
3require_once($CFG->libdir . '/portfoliolib.php');
4require_once($CFG->libdir . '/file/stored_file.php');
5require_once($CFG->libdir . '/filelib.php');
6
7$id = required_param('id', PARAM_INT);
8
9$exporter = portfolio_exporter::rewaken_object($id);
10
11if ($exporter->get('instance')->is_push()) {
34035201 12 throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio');
d96a1acc 13}
14
15if (!$exporter->get('instance')->verify_file_request_params(array_merge($_GET, $_POST))) {
34035201 16 throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio');
d96a1acc 17}
18
2eb07e79 19$exporter->get('instance')->send_file();
d96a1acc 20$exporter->process_stage_cleanup(true);
2eb07e79 21exit;
d96a1acc 22?>