Files
librenms-librenms/includes/html/pages/device/overview/services.inc.php
T
Tony MurrayandGitHub 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.9 KiB
PHP

<?php
if ($services['total']) {
// Build the string.
foreach (service_get($device['device_id']) as $data) {
if ($data['service_status'] == '0') {
// Ok
$status = 'green';
} elseif ($data['service_status'] == '1') {
// Warning
$status = 'red';
} elseif ($data['service_status'] == '2') {
// Critical
$status = 'red';
} else {
// Unknown
$status = 'grey';
}
$string .= $break . '<a class=' . $status . '>' . strtolower($data['service_type']) . '</a>';
$break = ', ';
}
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default panel-condensed">
<div class="panel-heading">
<i class="fa fa-cogs fa-lg icon-theme" aria-hidden="true"></i> <strong>Services</strong>
</div>
<table class="table table-hover table-condensed table-striped">
<tr>
<td title="Total"><i class="fa fa-cog" style="color:#0080FF" aria-hidden="true"></i> <?php echo $services['total']?></td>
<td title="Status - Ok"><i class="fa fa-cog" style="color:green" aria-hidden="true"></i> <?php echo $services[0]?></td>
<td title="Status - Warning"><i class="fa fa-cog" style="color:orange" aria-hidden="true"></i> <?php echo $services[1]?></td>
<td title="Status - Critical"><i class="fa fa-cog" style="color:red" aria-hidden="true"></i> <?php echo $services[2]?></td>
</tr>
<tr>
<td colspan='4'><?php echo $string?></td>
</tr>
</table>
</div>
</div>
</div>
<?php
}