mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
secured way to display rrd charts
This commit is contained in:
parent
d7105a8be8
commit
133a245528
2 changed files with 15 additions and 2 deletions
13
web/list/rrd/image.php
Normal file
13
web/list/rrd/image.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
if ($_SESSION['user'] != 'admin') exit;
|
||||
$real_path = realpath($_SERVER["DOCUMENT_ROOT"].$_SERVER['QUERY_STRING']);
|
||||
if (empty($real_path)) exit;
|
||||
$dir_name = dirname($real_path);
|
||||
$dir_name = dirname($dir_name);
|
||||
if ($dir_name != $_SERVER["DOCUMENT_ROOT"].'/rrd') exit;
|
||||
header("X-Accel-Redirect: ".$_SERVER['QUERY_STRING']);
|
||||
header("Content-Type: image/png");
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue