mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated to support a demo user
This commit is contained in:
@@ -31,7 +31,7 @@ echo('<div class="status-boxes">');
|
||||
$count_boxes = 0;
|
||||
|
||||
// Device down boxes
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
$sql = "SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0' LIMIT ".$config['front_page_down_box_limit'];
|
||||
} else {
|
||||
@@ -45,7 +45,7 @@ foreach (dbFetchRows($sql) as $device)
|
||||
++$count_boxes;
|
||||
}
|
||||
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
$sql = "SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0' LIMIT ".$config['front_page_down_box_limit'];
|
||||
} else {
|
||||
@@ -74,7 +74,7 @@ if ($config['warn']['ifdown'])
|
||||
|
||||
/* FIXME service permissions? seem nonexisting now.. */
|
||||
// Service down boxes
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
$sql = "SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0' LIMIT ".$config['front_page_down_box_limit'];
|
||||
$param[] = '';
|
||||
@@ -96,7 +96,7 @@ foreach (dbFetchRows($sql,$param) as $service)
|
||||
// BGP neighbour down boxes
|
||||
if (isset($config['enable_bgp']) && $config['enable_bgp'])
|
||||
{
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
$sql = "SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus != 'start' AND bgpPeerState != 'established' AND bgpPeerState != '' AND B.device_id = D.device_id AND D.ignore = 0 LIMIT ".$config['front_page_down_box_limit'];
|
||||
} else {
|
||||
@@ -115,7 +115,7 @@ if (isset($config['enable_bgp']) && $config['enable_bgp'])
|
||||
// Device rebooted boxes
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
$sql = "SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime > 0 AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0 LIMIT ".$config['front_page_down_box_limit'];
|
||||
} else {
|
||||
@@ -196,7 +196,7 @@ if ($config['enable_syslog'])
|
||||
|
||||
} else {
|
||||
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
$query = "SELECT *,DATE_FORMAT(datetime, '%D %b %T') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user