mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* 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/
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
$hostname = gethostbyid($alert_entry['device_id']);
|
|
$alert_state = $alert_entry['state'];
|
|
|
|
echo '<tr>
|
|
<td>
|
|
'.$alert_entry['time_logged'].'
|
|
</td>';
|
|
|
|
if (!isset($alert_entry['device'])) {
|
|
$dev = device_by_id_cache($alert_entry['device_id']);
|
|
echo '<td>
|
|
'.generate_device_link($dev, shorthost($dev['hostname'])).'
|
|
</td>';
|
|
}
|
|
|
|
echo '<td>'.htmlspecialchars($alert_entry['name']).'</td>';
|
|
|
|
echo "<td>";
|
|
if ($alert_state != '') {
|
|
if ($alert_state == '0') {
|
|
$fa_icon = 'check';
|
|
$fa_color = 'success';
|
|
$text = 'Ok';
|
|
} elseif ($alert_state == '1') {
|
|
$fa_icon = 'remove';
|
|
$fa_color = 'danger';
|
|
$text = 'Alert';
|
|
} elseif ($alert_state == '2') {
|
|
$fa_icon = 'info-circle';
|
|
$fa_color = 'muted';
|
|
$text = 'Ack';
|
|
} elseif ($alert_state == '3') {
|
|
$fa_icon = 'arrow-down';
|
|
$fa_color = 'warning';
|
|
$text = 'Worse';
|
|
} elseif ($alert_state == '4') {
|
|
$fa_icon = 'arrow-up';
|
|
$fa_color = 'info';
|
|
$text = 'Better';
|
|
}//end if
|
|
echo "<b><i class='fa fa-fw fa-".$fa_icon." text-".$fa_color."'></i> $text</b>";
|
|
}
|
|
echo "</td>";
|
|
|
|
echo '</tr>';
|