diff --git a/html/includes/.htaccess b/html/includes/.htaccess new file mode 100644 index 0000000000..8d2f25636d --- /dev/null +++ b/html/includes/.htaccess @@ -0,0 +1 @@ +deny from all diff --git a/html/map.php b/html/map.php new file mode 100755 index 0000000000..6e6ab7831a --- /dev/null +++ b/html/map.php @@ -0,0 +1,98 @@ += "10000000000") { + $info = "color=lightred style=\"setlinewidth(8)\""; + } elseif ($link['ifSpeed'] >= "1000000000") { + $info = "color=lightblue style=\"setlinewidth(4)\""; + } elseif ($link['ifSpeed'] >= "100000000") { + $info = "color=lightgrey style=\"setlinewidth(2)\""; + } elseif ($link['ifSpeed'] >= "10000000") { + $info = "style=\"setlinewidth(1)\""; + } else { + $info = "style=\"setlinewidth(1)\""; + } + + $src = $device['hostname']; + $dst = mysql_result(mysql_query("SELECT `hostname` FROM `devices` AS D, `interfaces` AS I WHERE I.interface_id = '$dst_if' AND D.device_id = I.device_id"),0); + $dst_host = mysql_result(mysql_query("SELECT D.device_id FROM `devices` AS D, `interfaces` AS I WHERE I.interface_id = '$dst_if' AND D.device_id = I.device_id"),0); + + + $sif = makeshortif($link['ifDescr']); + $dif = makeshortif(mysql_result(mysql_query("SELECT ifDescr from interfaces WHERE interface_id = '".$dst_if."'"),0)); + + $map .= "\"$src$sif\" [label=\"$sif\", fontsize=12, fillcolor=lightblue URL=\"/device/".$device['device_id']."/interface/$src_if/\"]\n"; + $map .= "\"$src\" -> \"$src$sif\" [weight=500000, arrowsize=0, len=0];\n"; + +# $map .= "\"$src$sif\" -> \"$dst$dif\" [weight=1] \n"; + + $map .= "\"$dst\" [URL=\"/device/$dst_host/map/\" fontsize=20 shape=box3d]\n"; + + if($dst_host == $device['device_id']) { + $map .= "\"$dst$dif\" [label=\"$dif\", fontsize=12, fillcolor=lightblue, URL=\"/device/$dst_host/interface/$dst_if/\"]\n"; + } else { + $map .= "\"$dst$dif\" [label=\"$dif\", fontsize=12, fillcolor=lightgray, URL=\"/device/$dst_host/interface/$dst_if/\"]\n"; + } + + + $map .= "\"$dst$dif\" -> \"$dst\" [weight=500000, arrowsize=0, len=0];\n"; + + $map .= "\"$src$sif\" -> \"$dst$dif\" [weight=1, arrowhead=normal, arrowtail=normal, len=2, $info] \n"; + + } + +} + +$map .= " +};"; + +#echo("
$map
"); + +$img = shell_exec("echo \"".addslashes($map)."\" | dot -T".$_GET['format'].""); +if($_GET['format'] == "png") { + header("Content-type: image/".$_GET['format']); +} elseif ($_GET['format'] == "svg") { + header("Content-type: image/svg+xml"); + $img = str_replace(" diff --git a/html/network/includes/.confirm_login.php.swp b/html/network/includes/.confirm_login.php.swp deleted file mode 100644 index e542b03859..0000000000 Binary files a/html/network/includes/.confirm_login.php.swp and /dev/null differ diff --git a/html/network/includes/.login.inc.php.swo b/html/network/includes/.login.inc.php.swo deleted file mode 100644 index e4331bcd51..0000000000 Binary files a/html/network/includes/.login.inc.php.swo and /dev/null differ diff --git a/html/network/includes/.login.inc.php.swp b/html/network/includes/.login.inc.php.swp deleted file mode 100644 index f8e57a0a5e..0000000000 Binary files a/html/network/includes/.login.inc.php.swp and /dev/null differ diff --git a/html/network/includes/authenticate.inc b/html/network/includes/authenticate.inc deleted file mode 100644 index 1fb38e34b9..0000000000 --- a/html/network/includes/authenticate.inc +++ /dev/null @@ -1,40 +0,0 @@ - diff --git a/html/network/includes/hostbox.inc b/html/network/includes/hostbox.inc deleted file mode 100644 index 14adee4804..0000000000 --- a/html/network/includes/hostbox.inc +++ /dev/null @@ -1,30 +0,0 @@ -$device[hostname]

"); - if($device[location] != "") { $locationhtml = $device[location]; } - - $type = strtolower($device['os']); - if(file_exists("..images/os/$type" . ".gif")){ $image = ""; } - - if ($device['os'] == "IOS") { - echo ("

-

$image
- $device[hardware]
$device[os] $device[version]
- $device[features]
- $locationhtml
- Up " . formatUptime($device[uptime]) ."

"); - } else { - echo ("

$image $device[os] $device[version] ($device[features]) -
$locationhtml
- Up " . formatUptime($device[uptime]) ."

"); - } - - if($_GET['page'] == 'device') { - if($_GET['graphs'] == 'yes') { - echo("

Hide Graphs

"); - } else { - echo("

Show Graphs

"); - } - } - -?> diff --git a/html/network/includes/ifbox.inc b/html/network/includes/ifbox.inc deleted file mode 100644 index 06fdc5c0d8..0000000000 --- a/html/network/includes/ifbox.inc +++ /dev/null @@ -1,23 +0,0 @@ -$inf

"); - if($ifalias && $ifalias != "") { echo("$ifalias
"); } - if($iftype && $iftype != "") { echo("$iftype "); - if($mac && $mac != "") { echo("$mac
"); - } else { echo("
"); } - } - - if($interface[ifType] != "softwareLoopback") { - if($speed == '0') { $speed = "0bps"; } - echo("$speed"); - if($interface[ifDuplex] != unknown) { echo(" / $interface[ifDuplex]-duplex"); } - if($interface[ifMtu] && $interface[ifMtu] != "") { echo(" / $interface[ifMtu]MTU"); } - echo("
"); - } - - echo ("$status
"); - - -?> diff --git a/html/network/includes/print-interface.inc b/html/network/includes/print-interface.inc deleted file mode 100644 index 767dd7c70a..0000000000 --- a/html/network/includes/print-interface.inc +++ /dev/null @@ -1,95 +0,0 @@ -";} - echo(" - - - $i. $inf -
$ifname"); - if($ifalias && $ifalias != "") { echo("$ifalias
"); } - unset ($break); - - $iftype = fixiftype($interface[ifType]); -if($show_all) { - if($iftype && $iftype != "") { echo("$iftype "); - if($mac && $mac != "") { echo("$mac
"); - } else { echo("
"); } - } - - if($interface[ifType] != "softwareLoopback") { - if($speed == '0') { $speed = "0bps"; } - echo("$speed"); - if($interface[ifDuplex] != unknown) { echo(" / $interface[ifDuplex]-duplex"); } - if($interface[ifMtu] && $interface[ifMtu] != "") { echo(" / $interface[ifMtu]MTU"); } - echo("
"); - } - - echo ("$status
"); -} - - $ipdata = mysql_query("SELECT * FROM `ipaddr` WHERE `interface_id` = '$interface[id]'"); - while($ip = mysql_fetch_Array($ipdata)) { - echo("$break $ip[addr]/$ip[cidr]"); - $break = "
"; - } - echo(""); - echo(""); - - if ( strpos($inf, "oopback") === false ) { - - $link_query = mysql_query("select I.if, D.hostname, D.id AS dev_id, I.id from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.id AND I.host = D.id"); - while($link = mysql_fetch_array($link_query)) { - $link_if = fixifName($link['if']); - echo("--> $link_if on $link[hostname]
"); - $br = "
"; - } - $adj_sql = "SELECT * FROM networks AS N, interfaces AS I, adjacencies AS A "; - $adj_sql = $adj_sql . "WHERE I.id = A.interface_id AND A.network_id = N.id "; - $adj_sql = $adj_sql . "AND I.id = '$if_id'"; - $adj_query = mysql_query("$adj_sql"); - while($adjs = mysql_fetch_array($adj_query)) { - $network_id = $adjs['network_id']; - $newsql = "SELECT *, I.id AS iid, D.id AS did FROM adjacencies AS A, networks as N, interfaces as I, devices as D "; - $newsql = $newsql . "WHERE N.id = '$network_id' AND A.network_id = N.id AND I.id = A.interface_id AND D.id = I.host "; - $newsql = $newsql . "AND D.id != '$device[id]' AND I.if NOT LIKE '%loopback%' GROUP BY D.id ORDER BY D.hostname"; - $new_query = mysql_query($newsql); - while($new = mysql_fetch_array($new_query)) { - if ($new['status'] == '0') { $class = "red"; } else { $class = "blue"; } - if ($new['ignore'] == '1') { - $class = "list-device-ignored"; - if ($new['status'] == '1') { $class = "green"; } - } - $this_ifid = $new['iid']; - $this_hostid = $new['did']; - $this_hostname = $new['hostname']; - $this_ifname = fixifName($new['if']); - $wq = mysql_query("select count(*) FROM links WHERE dst_if = '$this_ifid' AND src_if = $if_id;"); - if (@mysql_result($wq, 0) == '0') { - echo("$br  |- $this_ifname on $this_hostname"); - $br = "
"; - } - } - } - } - echo(""); - - // If we're showing graphs, generate the graph and print the img tags - if($_GET[graphs] == 'yes' && is_file("rrd/" . $hostname . ".". $ifIndex . ".rrd")) { - $trafgraph = trafgraph ($hostname . ".". $ifIndex . ".rrd", $hostname . ".". $ifIndex . "-traf.png"); - $trafgraphmonth = trafgraph ($hostname . ".". $ifIndex . ".rrd", $hostname . ".". $ifIndex . "-month-traf.png", "-1m"); - if($trafgraph !== false) { - echo(" "); - } - } - - $i++; - echo(""); - - -?> diff --git a/html/network/includes/topnav.inc b/html/network/includes/topnav.inc deleted file mode 100644 index 616c49690c..0000000000 --- a/html/network/includes/topnav.inc +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - -
- Network - - Wiki -
- Support - - DNS Admin -
diff --git a/html/pages/.htaccess b/html/pages/.htaccess new file mode 100644 index 0000000000..8d2f25636d --- /dev/null +++ b/html/pages/.htaccess @@ -0,0 +1 @@ +deny from all