diff --git a/html/includes/print-interface-adsl.inc.php b/html/includes/print-interface-adsl.inc.php
index f2d2e0900..43ecfa97a 100644
--- a/html/includes/print-interface-adsl.inc.php
+++ b/html/includes/print-interface-adsl.inc.php
@@ -1,6 +1,6 @@
0 || $interface['ifOutErrors_delta'] > 0)
{
$error_img = generate_port_link($interface," ","port_errors");
-} else { $error_img = ""; }
+} else {
+ $error_img = "";
+}
-# FIXME leading slash - does javascript honor base tag?
echo("
+onclick=\"location.href='device/".$device['device_id']."/port/".$interface['interface_id']."/'\" style='cursor: pointer;'>
");
echo("
" . generate_port_link($interface, $interface['ifIndex'] . ". ".$interface['label']) . "
@@ -30,17 +31,15 @@ unset ($break);
if ($port_details)
{
$ipdata = mysql_query("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
- while ($ip = mysql_fetch_Array($ipdata))
+ while ($ip = mysql_fetch_assoc($ipdata))
{
- # FIXME leading slash - does javascript honor base tag?
- echo("$break $ip[ipv4_address]/$ip[ipv4_prefixlen] ");
+ echo("$break ".$ip['ipv4_address']."/".$ip['ipv4_prefixlen']." ");
$break = ",";
}
$ip6data = mysql_query("SELECT * FROM `ipv6_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
- while ($ip6 = mysql_fetch_Array($ip6data))
+ while ($ip6 = mysql_fetch_assoc($ip6data))
{
- # FIXME leading slash - does javascript honor base tag?
- echo("$break ".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen']." ");
+ echo("$break ".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen']." ");
$break = ",";
}
}
@@ -141,7 +140,6 @@ if ($graph_type && is_file($graph_file))
onmouseout=\"return nd();\"> ");
echo(" ");
-
}
?>
\ No newline at end of file
diff --git a/html/pages/device/edit/device.inc.php b/html/pages/device/edit/device.inc.php
index 967896806..f426c4f0b 100644
--- a/html/pages/device/edit/device.inc.php
+++ b/html/pages/device/edit/device.inc.php
@@ -87,15 +87,16 @@ if ($updated && $update_message)
' . ucfirst($type) . '');
+ echo(' >' . ucfirst($type['type']) . '');
}
if ($unknown)
{
diff --git a/html/pages/device/routing/ospf.inc.php b/html/pages/device/routing/ospf.inc.php
index d9b968474..3c036f040 100644
--- a/html/pages/device/routing/ospf.inc.php
+++ b/html/pages/device/routing/ospf.inc.php
@@ -9,9 +9,8 @@ echo('');
#### Loop Instances
-while($instance = mysql_fetch_assoc($query))
+while ($instance = mysql_fetch_assoc($query))
{
-
if (!is_integer($i_i/2)) { $instance_bg = $list_colour_a; } else { $instance_bg = $list_colour_b; }
$area_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = '".$device['device_id']."'"),0);
@@ -25,9 +24,9 @@ while($instance = mysql_fetch_assoc($query))
$query .= " AND I.device_id = '".$device['device_id']."'";
$ipv4_host = mysql_fetch_assoc(mysql_query($query));
- if($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled '; } else { $enabled = 'disabled '; }
- if($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes '; } else { $abr = 'no '; }
- if($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes '; } else { $asbr = 'no '; }
+ if ($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled '; } else { $enabled = 'disabled '; }
+ if ($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes '; } else { $abr = 'no '; }
+ if ($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes '; } else { $asbr = 'no '; }
echo('Router Id Status ABR ASBR Areas Ports Neighbours ');
echo('');
@@ -49,9 +48,8 @@ while($instance = mysql_fetch_assoc($query))
$i_a = 0;
$a_sql = "SELECT * FROM `ospf_areas` WHERE `device_id` = '".$device['device_id']."'";
$a_query = mysql_query($a_sql);
- while($area = mysql_fetch_assoc($a_query))
+ while ($area = mysql_fetch_assoc($a_query))
{
-
if (!is_integer($i_a/2)) { $area_bg = $list_colour_b_a; } else { $area_bg = $list_colour_b_b; }
$area_port_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = '".$device['device_id']."' AND `ospfIfAreaId` = '".$area['ospfAreaId']."'"),0);
@@ -62,7 +60,7 @@ while($instance = mysql_fetch_assoc($query))
echo(' '.$area['ospfAreaId'] . ' ');
echo(' ' . $enabled . ' ');
echo(' ' . $area_port_count . '('.$area_port_count_enabled.') ');
- echo(' ');
+ echo('');
echo('');
echo('');
@@ -73,34 +71,38 @@ while($instance = mysql_fetch_assoc($query))
$i_p = $i_a + 1;
$p_sql = "SELECT * FROM `ospf_ports` AS O, `ports` AS P WHERE O.`ospfIfAdminStat` = 'enabled' AND O.`device_id` = '".$device['device_id']."' AND O.`ospfIfAreaId` = '".$area['ospfAreaId']."' AND P.interface_id = O.interface_id";
$p_query = mysql_query($p_sql);
- while($ospfport = mysql_fetch_assoc($p_query))
+ while ($ospfport = mysql_fetch_assoc($p_query))
{
-
- if (!is_integer($i_a/2)) {
+ if (!is_integer($i_a/2))
+ {
if (!is_integer($i_p/2)) { $port_bg = $list_colour_b_b; } else { $port_bg = $list_colour_b_a; }
} else {
if (!is_integer($i_p/2)) { $port_bg = $list_colour_a_b; } else { $port_bg = $list_colour_a_a; }
}
+ if ($ospfport['ospfIfAdminStat'] == "enabled")
+ {
+ $port_enabled = 'enabled ';
+ } else {
+ $port_enabled = 'disabled ';
+ }
- if($ospfport['ospfIfAdminStat'] == "enabled") { $port_enabled = 'enabled '; } else { $port_enabled = 'disabled '; }
-
echo(' ');
echo(' ');
echo(' '. generate_port_link($ospfport) . ' ');
echo(' ' . $port_enabled . ' ');
echo(' ' . $ospfport['ospfIfType'] . ' ');
echo(' ' . $ospfport['ospfIfState'] . ' ');
- echo(' ');
+ echo('');
$i_p++;
}
+
echo('
');
echo('');
echo('');
$i_a++;
-
} ### End loop areas
echo('');
@@ -108,7 +110,6 @@ while($instance = mysql_fetch_assoc($query))
echo('');
$i_i++;
-
} ### End loop instances
echo('');
diff --git a/html/pages/device/routing/overview/ospf.inc.php b/html/pages/device/routing/overview/ospf.inc.php
index 38b31b9da..99a12e9de 100644
--- a/html/pages/device/routing/overview/ospf.inc.php
+++ b/html/pages/device/routing/overview/ospf.inc.php
@@ -9,9 +9,8 @@ echo('');
#### Loop Instances
-while($instance = mysql_fetch_assoc($query))
+while ($instance = mysql_fetch_assoc($query))
{
-
if (!is_integer($i_i/2)) { $instance_bg = $list_colour_a; } else { $instance_bg = $list_colour_b; }
$area_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = '".$device['device_id']."'"),0);
@@ -22,9 +21,9 @@ while($instance = mysql_fetch_assoc($query))
$query .= " AND I.device_id = '".$device['device_id']."'";
$ipv4_host = mysql_fetch_assoc(mysql_query($query));
- if($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled '; } else { $enabled = 'disabled '; }
- if($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes '; } else { $abr = 'no '; }
- if($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes '; } else { $asbr = 'no '; }
+ if ($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled '; } else { $enabled = 'disabled '; }
+ if ($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes '; } else { $abr = 'no '; }
+ if ($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes '; } else { $asbr = 'no '; }
echo('Router Id Status ABR ASBR Areas Ports Neighbours ');
echo('');
@@ -37,9 +36,7 @@ while($instance = mysql_fetch_assoc($query))
echo(' ' . ($neighbour_count+0) . ' ');
echo(' ');
-
$i_i++;
-
} ### End loop instances
echo('
');
diff --git a/html/pages/routing.inc.php b/html/pages/routing.inc.php
index 152f03ca4..9d35968f6 100644
--- a/html/pages/routing.inc.php
+++ b/html/pages/routing.inc.php
@@ -21,7 +21,6 @@ echo("Routing » ");
unset($sep);
foreach ($datas as $type)
{
-
if (!$_GET['opta']) { $_GET['opta'] = $type; }
echo($sep);
diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php
index 0091f5879..a45b853b2 100644
--- a/html/pages/routing/bgp.inc.php
+++ b/html/pages/routing/bgp.inc.php
@@ -142,14 +142,12 @@ else
$afi = $afisafi['afi'];
$safi = $afisafi['safi'];
$this_afisafi = $afi.$safi;
- #$peer['afi'] .= $sep . $config['afi'][$afi][$safi]; ##### CLEAN ME UP, I AM MESSY AND I SMELL OF CHEESE! FIXME!
$peer['afi'] .= $sep . $afi .".".$safi;
$sep = " ";
$peer['afisafi'][$this_afisafi] = 1; ## Build a list of valid AFI/SAFI for this peer
}
unset($sep);
-
echo("
" . $localaddresslink . " ".generate_device_link($peer, shorthost($peer['hostname']), 'routing/bgp/')."
»
diff --git a/html/pages/routing/ospf.inc.php b/html/pages/routing/ospf.inc.php
index 74a6eb8af..426557363 100644
--- a/html/pages/routing/ospf.inc.php
+++ b/html/pages/routing/ospf.inc.php
@@ -10,9 +10,8 @@ echo('Device Router Id Status ABR ASBR
#### Loop Instances
-while($instance = mysql_fetch_assoc($query))
+while ($instance = mysql_fetch_assoc($query))
{
-
if (!is_integer($i_i/2)) { $instance_bg = $list_colour_a; } else { $instance_bg = $list_colour_b; }
$device = device_by_id_cache($instance['device_id']);
@@ -26,9 +25,9 @@ while($instance = mysql_fetch_assoc($query))
$ip_query .= " AND I.device_id = '".$device['device_id']."'";
$ipv4_host = mysql_fetch_assoc(mysql_query($ip_query));
- if($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled '; } else { $enabled = 'disabled '; }
- if($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes '; } else { $abr = 'no '; }
- if($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes '; } else { $asbr = 'no '; }
+ if ($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled '; } else { $enabled = 'disabled '; }
+ if ($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes '; } else { $abr = 'no '; }
+ if ($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes '; } else { $asbr = 'no '; }
echo(' ');
echo(' '.generate_device_link($device, 0, "routing/ospf/"). ' ');
@@ -42,7 +41,6 @@ while($instance = mysql_fetch_assoc($query))
echo(' ');
$i_i++;
-
} ### End loop instances
echo('');
diff --git a/includes/polling/bgp-peers.inc.php b/includes/polling/bgp-peers.inc.php
index e81bf34ba..7e4afa00e 100755
--- a/includes/polling/bgp-peers.inc.php
+++ b/includes/polling/bgp-peers.inc.php
@@ -137,7 +137,7 @@ else
{
$afi = $peer_afi['afi'];
$safi = $peer_afi['safi'];
- if ($debug) { echo("$afi $safi". $config['afi'][$afi][$safi]. "\n"); }
+ if ($debug) { echo("$afi $safi\n"); }
if ($device['os_group'] == "ios")
{
diff --git a/includes/static-config.php b/includes/static-config.php
index b797d6b6e..9aba90101 100644
--- a/includes/static-config.php
+++ b/includes/static-config.php
@@ -6,14 +6,6 @@
# YES, THAT MEANS YOU #
#########################################################
-## AFI / SAFI pairs for BGP (and other stuff, perhaps)
-$config['afi']['ipv4']['unicast'] = "IPv4";
-$config['afi']['ipv4']['multiicast'] = "IPv4 Multicast";
-$config['afi']['ipv4']['vpn'] = "VPNv4";
-$config['afi']['ipv6']['unicast'] = "IPv6";
-$config['afi']['ipv6']['multicast'] = "IPv6 Multicast";
-$config['afi']['ipv4']['vpn'] = "VPNv6";
-
$config['os']['default']['over'][0]['graph'] = "device_processor";
$config['os']['default']['over'][0]['text'] = "Processor Usage";
$config['os']['default']['over'][1]['graph'] = "device_mempool";
@@ -23,7 +15,6 @@ $os_group = "unix";
$config['os_group'][$os_group]['type'] = "server";
$config['os_group'][$os_group]['processor_stacked'] = 1;
-
$os = "generic";
$config['os'][$os]['text'] = "Generic Device";
@@ -714,7 +705,8 @@ $config['os'][$os]['icon'] = "tripplite";
foreach($config['os'] as $this_os => $blah)
{
- if (isset($config['os'][$this_os]['group'])){
+ if (isset($config['os'][$this_os]['group']))
+ {
$this_os_group = $config['os'][$this_os]['group'];
if (isset($config['os_group'][$this_os_group]))
{
@@ -729,8 +721,6 @@ foreach($config['os'] as $this_os => $blah)
}
}
-$device_types = array('server', 'network', 'firewall', 'workstation', 'printer', 'power', 'environment');
-
### Graph Types
$config['graph_sections'] = array('system', 'firewall', 'netstats', 'wireless', 'storage');
@@ -887,7 +877,6 @@ if (isset($config['enable_printers']) && $config['enable_printers'])
}
-
##############################
# No changes below this line #
##############################