mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
36431dd296
* 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/
27 lines
1.2 KiB
PHP
27 lines
1.2 KiB
PHP
<?php
|
|
echo '<table class="table table-hover table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>Local Port</th>
|
|
<th>Remote Device</th>
|
|
<th>Remote Port</th>
|
|
<th>Protocol</th>
|
|
</tr>
|
|
</thead>';
|
|
|
|
foreach (dbFetchRows('SELECT * FROM links AS L, ports AS I WHERE I.device_id = ? AND I.port_id = L.local_port_id', array($device['device_id'])) as $neighbour) {
|
|
$neighbour = cleanPort($neighbour);
|
|
echo '<td>' . generate_port_link($neighbour) . '<br>' . $neighbour['ifAlias'] . '</td>';
|
|
if (is_numeric($neighbour['remote_port_id']) && $neighbour['remote_port_id']) {
|
|
$remote_port = cleanPort(get_port_by_id($neighbour['remote_port_id']));
|
|
$remote_device = device_by_id_cache($remote_port['device_id']);
|
|
echo '<td>' . generate_device_link($remote_device) . '<br>' . $remote_device['hardware'] . '</td>
|
|
<td>' . generate_port_link($remote_port) . '<br>' . $remote_port['ifAlias'] . '</td>';
|
|
} else {
|
|
echo '<td>' . $neighbour['remote_hostname'] . '<br>' . $neighbour['remote_platform'] . '</td>
|
|
<td>' . $neighbour['remote_port'] . '</td>';
|
|
}
|
|
echo '<td>' . strtoupper($neighbour['protocol']) . '</td></tr>';
|
|
}
|
|
echo '</table>';
|