aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rrd.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-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}