only display routing menu when we have routing. update readme and changelog

git-svn-id: http://www.observium.org/svn/observer/trunk@2250 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-05 14:23:09 +00:00
parent 65c4c63efc
commit bd56d2e3fe
3 changed files with 7 additions and 19 deletions

View File

@@ -274,18 +274,11 @@ foreach (array_keys($menu_sensors) as $item)
<?php
$routing_count['bgp'] = mysql_result(mysql_query("SELECT COUNT(*) from `bgpPeers`"), 0);
if ($routing_count['bgp']) { $datas[] = 'bgp'; }
$routing_count['ospf'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_instances` WHERE `ospfAdminStat` = 'enabled'"), 0);
if ($routing_count['ospf']) { $datas[] = 'ospf'; }
$routing_count['cef'] = mysql_result(mysql_query("SELECT COUNT(*) from `cef_switching`"), 0);
if ($routing_count['cef']) { $datas[] = 'cef'; }
$routing_count['vrf'] = @mysql_result(mysql_query("SELECT COUNT(*) from `vrfs`"), 0);
if($routing_count['vrf']) { $datas[] = 'vrf'; }
if ($_SESSION['userlevel'] >= '5')
if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf']+$routing_count['cef']+$routing_count['vrf']) > "0")
{
echo('
<li><a class="menu2four" href="routing/"><img src="images/16/arrow_branch.png" border="0" align="absmiddle" /> Routing</a>