Files

89 lines
2.4 KiB
PHP
Raw Permalink Normal View History

2007-04-04 10:15:07 +00:00
<?php
2018-09-11 07:51:35 -05:00
use LibreNMS\Authentication\LegacyAuth;
2016-08-18 20:28:22 -05:00
$no_refresh = true;
2011-09-18 18:38:42 +00:00
$link_array = array('page' => 'device',
2015-07-13 20:10:26 +02:00
'device' => $device['device_id'],
'tab' => 'edit');
2011-09-18 18:38:42 +00:00
2018-09-11 07:51:35 -05:00
if (!LegacyAuth::user()->hasGlobalAdmin()) {
2016-08-18 20:28:22 -05:00
print_error("Insufficient Privileges");
} else {
$panes['device'] = 'Device Settings';
$panes['snmp'] = 'SNMP';
if (!$device['snmp_disable']) {
$panes['ports'] = 'Port Settings';
}
2016-08-18 20:28:22 -05:00
2018-09-11 05:54:46 +02:00
if (dbFetchCell("SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = ? LIMIT 1", array($device['device_id'])) > 0) {
$panes['routing'] = 'Routing';
}
2016-08-18 20:28:22 -05:00
if (count($config['os'][$device['os']]['icons'])) {
$panes['icon'] = 'Icon';
}
2014-06-14 23:05:31 +01:00
if (!$device['snmp_disable']) {
$panes['apps'] = 'Applications';
}
2016-08-18 20:28:22 -05:00
$panes['alerts'] = 'Alert Settings';
$panes['alert-rules'] = 'Alert Rules';
if (!$device['snmp_disable']) {
$panes['modules'] = 'Modules';
}
2015-08-03 10:46:40 +00:00
2016-08-18 20:28:22 -05:00
if ($config['show_services']) {
$panes['services'] = 'Services';
}
2015-08-15 16:01:43 +10:00
2016-08-18 20:28:22 -05:00
$panes['ipmi'] = 'IPMI';
2017-05-01 23:49:11 -05:00
if (dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = ? AND `sensor_deleted`='0' LIMIT 1", array($device['device_id'])) > 0) {
2016-08-18 20:28:22 -05:00
$panes['health'] = 'Health';
2015-07-13 20:10:26 +02:00
}
2011-09-18 18:38:42 +00:00
2017-05-01 23:49:11 -05:00
if (dbFetchCell("SELECT COUNT(*) FROM `wireless_sensors` WHERE `device_id` = ? AND `sensor_deleted`='0' LIMIT 1", array($device['device_id'])) > 0) {
$panes['wireless-sensors'] = 'Wireless Sensors';
}
if (!$device['snmp_disable']) {
$panes['storage'] = 'Storage';
$panes['processors'] = 'Processors';
$panes['mempools'] = 'Memory';
}
2016-08-18 20:28:22 -05:00
$panes['misc'] = 'Misc';
$panes['component'] = 'Components';
print_optionbar_start();
unset($sep);
foreach ($panes as $type => $text) {
if (!isset($vars['section'])) {
$vars['section'] = $type;
}
echo($sep);
if ($vars['section'] == $type) {
echo("<span class='pagemenu-selected'>");
} else {
}
echo(generate_link($text, $link_array, array('section'=>$type)));
if ($vars['section'] == $type) {
echo("</span>");
}
$sep = " | ";
2015-07-13 20:10:26 +02:00
}
2016-08-18 20:28:22 -05:00
print_optionbar_end();
2007-04-04 10:15:07 +00:00
2016-08-18 20:28:22 -05:00
if (is_file("pages/device/edit/".mres($vars['section']).".inc.php")) {
require "pages/device/edit/".mres($vars['section']).".inc.php";
}
2007-04-04 10:15:07 +00:00
}
$pagetitle[] = "Settings";