aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rrd.php
diff options
context:
space:
mode:
authorPim van den Berg2013-05-18 16:05:43 +0200
committerPim van den Berg2013-05-18 16:08:09 +0200
commit5793a8cd003643974206e44ea752ab0966cfa8c0 (patch)
tree387a6a327af9834f2986ad3316be2183949d897a /rrd.php
parentjsrrdgraph: RrdGraph.js: fix undefined 2nd argument of RrdVdef function (diff)
downloadapt-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.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/rrd.php b/rrd.php
new file mode 100644
index 0000000..58614a0
--- /dev/null
+++ b/rrd.php
@@ -0,0 +1,24 @@
1<?php
2
3require_once 'conf/common.inc.php';
4require_once 'inc/functions.inc.php';
5require_once 'inc/html.inc.php';
6
7if ($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
22EOT;
23 html_end();
24}