aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rrd.php
diff options
context:
space:
mode:
authorPim van den Berg2014-08-10 14:36:23 +0200
committerPim van den Berg2014-08-10 14:36:23 +0200
commit9d27dfc35d1890877d9f18cfa2c6e75ba0720fdf (patch)
treecb3b7032aba48b52203163aad0bf4683e54476cb /rrd.php
parentjsrrdgraph: Fix parsing of rrdfiles containing escapes (diff)
parentSupport customized RRD URLs (diff)
downloadapt-panopticon_cgp-9d27dfc35d1890877d9f18cfa2c6e75ba0720fdf.zip
apt-panopticon_cgp-9d27dfc35d1890877d9f18cfa2c6e75ba0720fdf.tar.gz
apt-panopticon_cgp-9d27dfc35d1890877d9f18cfa2c6e75ba0720fdf.tar.bz2
apt-panopticon_cgp-9d27dfc35d1890877d9f18cfa2c6e75ba0720fdf.tar.xz
Merge remote-tracking branch 'lekensteyn/custom-urls'
Diffstat (limited to 'rrd.php')
-rw-r--r--rrd.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/rrd.php b/rrd.php
index b4c7f68..d4f29ee 100644
--- a/rrd.php
+++ b/rrd.php
@@ -4,7 +4,13 @@ require_once 'conf/common.inc.php';
4require_once 'inc/functions.inc.php'; 4require_once 'inc/functions.inc.php';
5require_once 'inc/html.inc.php'; 5require_once 'inc/html.inc.php';
6 6
7if ( $file = validateRRDPath($CONFIG['datadir'], urldecode($_SERVER["QUERY_STRING"])) ) { 7$path = filter_input(INPUT_GET, 'path');
8if (!$path) {
9 // legacy option: rrd.php?some.host/load/load.rrd
10 $path = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
11}
12
13if ( $file = validateRRDPath($CONFIG['datadir'], $path) ) {
8 header('Content-Type: application/octet-stream'); 14 header('Content-Type: application/octet-stream');
9 header('Content-Disposition: attachment; filename='.basename($file)); 15 header('Content-Disposition: attachment; filename='.basename($file));
10 header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds"))); 16 header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds")));
@@ -15,10 +21,11 @@ if ( $file = validateRRDPath($CONFIG['datadir'], urldecode($_SERVER["QUERY_STRIN
15 header('HTTP/1.0 403 Forbidden'); 21 header('HTTP/1.0 403 Forbidden');
16 22
17 html_start(); 23 html_start();
24 $html_weburl = htmlentities($CONFIG['weburl']);
18 echo <<<EOT 25 echo <<<EOT
19<fieldset id="forbidden"> 26<fieldset id="forbidden">
20<legend>forbidden</legend> 27<legend>forbidden</legend>
21<p><a href="{$CONFIG['weburl']}">Return home...</a></p> 28<p><a href="{$html_weburl}">Return home...</a></p>
22</fieldset> 29</fieldset>
23 30
24EOT; 31EOT;