mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	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/
This commit is contained in:
		
							
								
								
									
										41
									
								
								includes/html/graphs/application/shoutcast_stats.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								includes/html/graphs/application/shoutcast_stats.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$hostname     = (isset($_GET['hostname']) ? $_GET['hostname'] : 'unkown');
 | 
			
		||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id'], $hostname));
 | 
			
		||||
 | 
			
		||||
require 'includes/html/graphs/common.inc.php';
 | 
			
		||||
 | 
			
		||||
$rrd_options .= ' DEF:cur='.$rrd_filename.':current:AVERAGE';
 | 
			
		||||
$rrd_options .= ' DEF:max='.$rrd_filename.':max:MAX';
 | 
			
		||||
// $rrd_options .= " DEF:bit=".$rrd_filename.":bitrate:LAST";
 | 
			
		||||
$rrd_options .= ' DEF:bit='.$rrd_filename.':bitrate:MAX';
 | 
			
		||||
$rrd_options .= ' DEF:peak='.$rrd_filename.':peak:MAX';
 | 
			
		||||
$rrd_options .= ' DEF:unique='.$rrd_filename.':unique:AVERAGE';
 | 
			
		||||
$rrd_options .= ' DEF:status='.$rrd_filename.':status:AVERAGE';
 | 
			
		||||
$rrd_options .= ' CDEF:peakm=peak,1,-';
 | 
			
		||||
$rrd_options .= ' VDEF:avg=cur,AVERAGE';
 | 
			
		||||
$rrd_options .= ' VDEF:peakh=peakm,MAXIMUM';
 | 
			
		||||
$rrd_options .= ' CDEF:bitrate=bit,8,*';
 | 
			
		||||
$rrd_options .= ' CDEF:server=status,UN,1,0,IF';
 | 
			
		||||
$rrd_options .= ' CDEF:server_offline=status,1,LT,1,UNKN,IF';
 | 
			
		||||
$rrd_options .= ' CDEF:stream=max,UN,1,0,IF';
 | 
			
		||||
$rrd_options .= ' CDEF:stream_offline=max,1,LT,1,UNKN,IF';
 | 
			
		||||
$rrd_options .= ' AREA:cur#63C2FEFF:"Current Listeners"';
 | 
			
		||||
 | 
			
		||||
if ($width >= 355) {
 | 
			
		||||
    $rrd_options .= ' GPRINT:cur:LAST:"\:%8.2lf"';
 | 
			
		||||
    $rrd_options .= ' GPRINT:max:LAST:"from%8.2lf"';
 | 
			
		||||
    $rrd_options .= ' GPRINT:bitrate:LAST:"(bitrate\:%8.2lf%s"';
 | 
			
		||||
    $rrd_options .= " COMMENT:\")\\n\"";
 | 
			
		||||
} else {
 | 
			
		||||
    $rrd_options .= " GPRINT:cur:LAST:\"\:%8.2lf\\n\"";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$rrd_options .= ' AREA:unique#AADEFEFF:"Unique Listeners "';
 | 
			
		||||
$rrd_options .= " GPRINT:unique:LAST:\"\:%8.2lf%s\\n\"";
 | 
			
		||||
$rrd_options .= ' HRULE:avg#FF9000FF:"Average Listeners"';
 | 
			
		||||
$rrd_options .= " GPRINT:avg:\"\:%8.2lf\\n\"";
 | 
			
		||||
$rrd_options .= ' LINE1:peak#C000FFFF:"Peak Listeners   "';
 | 
			
		||||
$rrd_options .= " GPRINT:peak:LAST:\"\:%8.2lf\\n\"";
 | 
			
		||||
$rrd_options .= " TICK:stream_offline#B4FF00FF:1.0:\"Streaming client offline\\n\"";
 | 
			
		||||
$rrd_options .= ' TICK:server_offline'.$config['warn_colour_alt'].'FF:1.0:"Streaming server offline"';
 | 
			
		||||
		Reference in New Issue
	
	Block a user