Files
librenms-librenms/includes/html/graphs/device/xirrus_stations.inc.php
Tony Murray 36431dd296 Security fix: unauthorized access (#10091)
* Security fix: unauthorized access
Affects nginx users:
Moved php files outside of public html directory (Apache was protected by .htaccess)

Affects all users:
Some files did not check for authentication and could disclose some info.
Better checks before including files from user input

* git mv html/includes/ includes/html
git mv html/pages/ includes/html/
2019-04-11 23:26:42 -05:00

45 lines
1.1 KiB
PHP

<?php
require 'includes/html/graphs/common.inc.php';
$pallette = array(
1 => '001080',
2 => '043D85',
3 => '096C8A',
4 => '0F8F84',
5 => '159461',
6 => '1B9A3E',
7 => '279F22',
8 => '56A429',
9 => '83A930',
10 => 'AEAE38',
11 => 'B48E40',
12 => 'B97049',
13 => 'BE5552',
14 => 'C35B79',
15 => 'C864A1',
16 => 'CE6FC7'
);
$rrd_options .= ' -l 0 -E ';
$rrd_options .= " COMMENT:'Associated Stations Cur Min Max\\n'";
$radioId=1;
foreach (glob(rrd_name($device['hostname'], 'xirrus_users-', '*.rrd')) as $rrd) {
// get radio name
preg_match("/xirrus_users-iap([0-9]{1,2}).rrd/", $rrd, $out);
list(,$radioId)=$out;
// build graph
$color=$pallette[$radioId];
$descr = "iap$radioId ";
$rrd_options .= " DEF:stations$radioId=$rrd:stations:AVERAGE";
$rrd_options .= " AREA:stations$radioId#".$color.":'".$descr."':STACK";
$rrd_options .= " GPRINT:stations$radioId:LAST:'%5.0lf'";
$rrd_options .= " GPRINT:stations$radioId:MIN:'%5.0lf'";
$rrd_options .= " GPRINT:stations$radioId:MAX:'%5.0lf'\\l";
$radioId++;
}//end foreach