more csrf work
[openemr.git] / custom / qrda_download.php
blobb8a8336749e89121df36dc9195d7bb9028c4ec42
1 <?php
2 /**
4 * QRDA Download
6 * Copyright (C) 2015 Ensoftek, Inc
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Ensoftek
21 * @link http://www.open-emr.org
24 // This program exports(Download) to QRDA Category III XML.
26 require_once("../interface/globals.php");
28 $qrda_fname = $_GET['qrda_fname'];
29 check_file_dir_name($qrda_fname);
30 if ($qrda_fname != "") {
31 $qrda_file_path = $GLOBALS['OE_SITE_DIR'] . "/documents/cqm_qrda/";
32 $xmlurl = $qrda_file_path.$qrda_fname;
34 header("Pragma: public"); // required
35 header("Expires: 0");
36 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
37 header("Cache-Control: private", false); // required for certain browsers
38 header('Content-type: application/xml');
39 header("Content-Disposition: attachment; filename=\"".basename($xmlurl)."\";");
40 header("Content-Transfer-Encoding: binary");
41 header("Content-Length: ". filesize($xmlurl));
42 ob_clean();
43 flush();
44 readfile($xmlurl);
45 } else {
46 echo xlt("File path not found.");