MDL-18733 adding note - we need to use user keys instead of cookies here
[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);
6b6f1c05 10$exporter->verify_rewaken();
d96a1acc 11
12if ($exporter->get('instance')->is_push()) {
34035201 13 throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio');
d96a1acc 14}
15
16if (!$exporter->get('instance')->verify_file_request_params(array_merge($_GET, $_POST))) {
34035201 17 throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio');
d96a1acc 18}
19
2eb07e79 20$exporter->get('instance')->send_file();
d96a1acc 21$exporter->process_stage_cleanup(true);
2eb07e79 22exit;
d96a1acc 23?>