diff options
author | Pim van den Berg | 2013-05-18 16:05:43 +0200 |
---|---|---|
committer | Pim van den Berg | 2013-05-18 16:08:09 +0200 |
commit | 5793a8cd003643974206e44ea752ab0966cfa8c0 (patch) | |
tree | 387a6a327af9834f2986ad3316be2183949d897a /rrd.php | |
parent | jsrrdgraph: RrdGraph.js: fix undefined 2nd argument of RrdVdef function (diff) | |
download | apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.zip apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.tar.gz apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.tar.bz2 apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.tar.xz |
integrate jsrrdgraph in CGP
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 | } | ||