|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00030 require_once(dirname(dirname(__FILE__)) . '/config.php'); 00031 00032 if (empty($CFG->enableportfolios)) { 00033 print_error('disabled', 'portfolio'); 00034 } 00035 00036 require_once($CFG->libdir . '/portfoliolib.php'); 00037 require_once($CFG->libdir . '/portfolio/exporter.php'); 00038 require_once($CFG->libdir . '/filelib.php'); 00039 00040 // exporter id 00041 $id = required_param('id', PARAM_INT); 00042 00043 require_login(); 00044 $PAGE->set_url('/portfolio/add.php', array('id' => $id)); 00045 00046 $exporter = portfolio_exporter::rewaken_object($id); 00047 $exporter->verify_rewaken(); 00048 00049 // push plugins don't need to access this script. 00050 if ($exporter->get('instance')->is_push()) { 00051 throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio'); 00052 } 00053 00054 // it's up to the plugin to verify the request parameters, like a token or whatever 00055 if (!$exporter->get('instance')->verify_file_request_params(array_merge($_GET, $_POST))) { 00056 throw new portfolio_export_exception($exporter, 'filedenied', 'portfolio'); 00057 } 00058 00059 // ok, we're good, send the file and finish the export. 00060 $exporter->get('instance')->send_file(); 00061 $exporter->process_stage_cleanup(true); 00062 exit; 00063