diff options
Diffstat (limited to 'rrd.php')
| -rw-r--r-- | rrd.php | 24 |
1 files changed, 24 insertions, 0 deletions
| @@ -0,0 +1,24 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | require_once 'conf/common.inc.php'; | ||
| 4 | require_once 'inc/functions.inc.php'; | ||
| 5 | require_once 'inc/html.inc.php'; | ||
| 6 | |||
| 7 | if ($file = validateRRDPath($CONFIG['datadir'], $_GET['path'])) { | ||
| 8 | header('Content-Type: application/octet-stream'); | ||
| 9 | header('Content-Disposition: attachment; filename='.basename($file)); | ||
| 10 | header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds"))); | ||
| 11 | ob_clean(); | ||
| 12 | flush(); | ||
| 13 | readfile($file); | ||
| 14 | } else { | ||
| 15 | header('HTTP/1.0 403 Forbidden'); | ||
| 16 | |||
| 17 | html_start(); | ||
| 18 | echo <<<EOT | ||
| 19 | <h2>Forbidden</h2> | ||
| 20 | <p><a href="{$CONFIG['weburl']}">Return home...</a></p> | ||
| 21 | |||
| 22 | EOT; | ||
| 23 | html_end(); | ||
| 24 | } | ||
