diff --git a/html/images/no-48.png b/html/images/no-48.png new file mode 100644 index 000000000..ddcef3118 Binary files /dev/null and b/html/images/no-48.png differ diff --git a/html/includes/error-no-perm.inc.php b/html/includes/error-no-perm.inc.php new file mode 100644 index 000000000..482d99890 --- /dev/null +++ b/html/includes/error-no-perm.inc.php @@ -0,0 +1,32 @@ + + + + + + + +
+
+ + + + +
+ + Error: + You have insufficent permissions to view this page. + +
+
+
+ + + + + + +"); + +?> diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 6572ebde5..fb3850ea6 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -132,7 +132,7 @@ if($config['enable_pseudowires']) { echo("
  • IPv4 Search
  • -
  • IPv6 Search
  • +
  • IPv6 Search
  • "); // Display devices this users has access to echo("

    Device Access

    "); - $device_perm_data = mysql_query("SELECT * from devices_perms as P, devices as D WHERE `user_id` = '" . $_GET['user_id'] . "' AND D.device_id = P.device_id"); - while($device_perm = mysql_fetch_array($device_perm_data)) { - echo($device_perm['hostname'] . "
    "); - $access_list[] = $device_perm['device_id']; - $permdone = "yes"; - } - - if(!$permdone) { echo("None Configured"); } - // Display devices this user doesn't have access to echo("

    Grant access to new device

    "); echo("
    @@ -93,6 +84,17 @@ echo(" +
    + + + + + + +
    +
    +
    "); } echo(" "); + + + $device_perm_data = mysql_query("SELECT * from devices_perms as P, devices as D WHERE `user_id` = '" . $_GET['user_id'] . "' AND D.device_id = P.device_id"); + while($device_perm = mysql_fetch_array($device_perm_data)) { + echo($device_perm['hostname'] . "
    "); + $access_list[] = $device_perm['device_id']; + $permdone = "yes"; + } + + if(!$permdone) { echo("None Configured"); } + echo("
    "); echo("

    Interface Access

    "); diff --git a/html/pages/ipv4.php b/html/pages/ipv4.php index 195be1f66..e15f0f192 100644 --- a/html/pages/ipv4.php +++ b/html/pages/ipv4.php @@ -1,7 +1,17 @@ - - +
    + + + + + + +
    +
    + +
    + - - -
    + +
    + + + + + + + + + + + -
    + - -
    + +
    + + + + + + + + + + + "); diff --git a/html/pages/pseudowires.php b/html/pages/pseudowires.php index cbc7f5e5b..ab9cf4b40 100644 --- a/html/pages/pseudowires.php +++ b/html/pages/pseudowires.php @@ -9,20 +9,24 @@ while($pw_a = mysql_fetch_array($query)) { $i = 0; while ($i < count($linkdone)) { $thislink = $pw_a['device_id'] . $pw_a['interface_id']; - if ($linkdone[$i] == $thislink) { $dupe = "yes"; } + if ($linkdone[$i] == $thislink) { $skip = "yes"; } $i++; } - - if($dupe) { - unset($dupe); - } else { - if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; } - $pw_b = mysql_fetch_array(mysql_query("SELECT * from `devices` AS D, `interfaces` AS I, `pseudowires` AS P WHERE D.device_id = '".$pw_a['peer_device_id']."' AND + $pw_b = mysql_fetch_array(mysql_query("SELECT * from `devices` AS D, `interfaces` AS I, `pseudowires` AS P WHERE D.device_id = '".$pw_a['peer_device_id']."' AND D.device_id = I.device_id AND P.cpwVcID = '".$pw_a['cpwVcID']."' AND P.interface_id = I.interface_id")); + if(!interfacepermitted($pw_a['interface_id'])) { $skip = "yes"; } + if(!interfacepermitted($pw_b['interface_id'])) { $skip = "yes"; } + + + if($skip) { + unset($skip); + } else { + if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; } + echo("".$pw_a['cpwVcID']."".generatedevicelink($pw_a)."".generateiflink($pw_a)." => ".generatedevicelink($pw_b)."".generateiflink($pw_b).""); diff --git a/html/pages/vrfs.php b/html/pages/vrfs.php index 801e44d52..61cb4b854 100644 --- a/html/pages/vrfs.php +++ b/html/pages/vrfs.php @@ -1,13 +1,32 @@ = '5') { + echo(" -
    +
    + + + + + + +
    +
    Basic | Graphs : Bits | Packets | NU Packets | Errors -
    "); +
    +
    + + + + + + +
    +"); echo("
    "); @@ -16,45 +35,38 @@ echo(" while($vrf = mysql_fetch_array($vrf_query)) { if(!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; } - echo(""); - echo(""); echo(""); - -# echo(""); - + #echo(""); echo(""); @@ -63,5 +75,11 @@ echo(" } echo("
    " . $vrf['vrf_name'] . "
    " . $vrf['mplsVpnVrfDescription'] . "
    " . $vrf['mplsVpnVrfRouteDistinguisher'] . "" . $vrf['mplsVpnVrfDescription'] . "" . $vrf['mplsVpnVrfDescription'] . ""); - $devices = mysql_query("SELECT * FROM `vrfs` AS V, `devices` AS D WHERE `mplsVpnVrfRouteDistinguisher` = '".$vrf['mplsVpnVrfRouteDistinguisher']."' AND D.device_id = V.device_id"); $x=1; while($device = mysql_fetch_array($devices)) { + if(!is_integer($i/2)) { if(!is_integer($x/2)) { $dev_colour = $list_colour_a_a; } else { $dev_colour = $list_colour_a_b; } } else { if(!is_integer($x/2)) { $dev_colour = $list_colour_b_b; } else { $dev_colour = $list_colour_b_a; } } - echo(""); $x++; - } + } // End While echo("
    ".generatedevicelink($device)); + echo("
    ".generatedevicelink($device, shorthost($device['hostname']))); if($device['vrf_name'] != $vrf['vrf_name']) { echo("Configured : ".$device['vrf_name']."', CAPTION, 'VRF Inconsistency' ,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"> "); } echo(""); $interfaces = mysql_query("SELECT * FROM `interfaces` WHERE `ifVrf` = '".$device['vrf_id']."' and device_id = '".$device['device_id']."'"); unset($seperator); while($port = mysql_fetch_array($interfaces)) { - - if($_GET['opta']) { - $graph_type = $_GET['opta']; - include("includes/print-port-thumbs.inc.php"); - - } else { - - $port = array_merge ($device, $port); - echo($seperator.generateiflink($port,makeshortif($port['ifDescr']))); - $seperator = ", "; - } + if($_GET['opta']) { + $graph_type = $_GET['opta']; + include("includes/print-port-thumbs.inc.php"); + } else { + $port = array_merge ($device, $port); + echo($seperator.generateiflink($port,makeshortif($port['ifDescr']))); + $seperator = ", "; + } } echo("
    "); +} else { + +include("includes/error-no-perm.inc.php"); + +} ## End Permission if + ?>