// get node network info
if( !empty( $interface_ids ) )
- $node_networks= $api->GetInterfaces( $interface_ids );
+ $interfaces= $api->GetInterfaces( $interface_ids );
// gets nodegroup info
if( !empty( $nodegroup_ids ) )
echo "<hr />\n";
// display node networks
- if( $node_networks ) {
+ if( $interfaces ) {
echo "<p><table class='list_set' border=0 cellpadding=2>\n";
echo "<caption class='list_set'>Node Networks</caption>\n";
echo "<thead><tr class='list_set'>";
}
echo "<th class='list_set'>IP Address</th><th class='list_set'>Method</th><th class='list_set'>Type</th><th class='list_set'>MAC</th><th class='list_set'>Bandwidth Limit</th></tr></thead><tbody>\n";
- foreach( $node_networks as $node_network ) {
- $nn_id= $node_network['interface_id'];
- $nn_ip= $node_network['ip'];
- $nn_broad= $node_network['broadcast'];
- $nn_primary= $node_network['is_primary'];
- $nn_network= $node_network['network'];
- $nn_dns1= $node_network['dns1'];
- $nn_dns2= $node_network['dns2'];
- $nn_hostname= $node_network['hostname'];
- $nn_netmaks= $node_network['netmask'];
- $nn_gatewary= $node_network['gateway'];
- $nn_mac= $node_network['mac'];
- $nn_bwlimit= $node_network['bwlimit'];
- $nn_type= $node_network['type'];
- $nn_method= $node_network['method'];
+ foreach( $interfaces as $interface ) {
+ $nn_id= $interface['interface_id'];
+ $nn_ip= $interface['ip'];
+ $nn_broad= $interface['broadcast'];
+ $nn_primary= $interface['is_primary'];
+ $nn_network= $interface['network'];
+ $nn_dns1= $interface['dns1'];
+ $nn_dns2= $interface['dns2'];
+ $nn_hostname= $interface['hostname'];
+ $nn_netmaks= $interface['netmask'];
+ $nn_gatewary= $interface['gateway'];
+ $nn_mac= $interface['mac'];
+ $nn_bwlimit= $interface['bwlimit'];
+ $nn_type= $interface['type'];
+ $nn_method= $interface['method'];
echo "<tr class='list_set'>";
if ( $is_admin || ($is_pi && $in_site)) {
echo "<td class='list_set'>";
if (!$nn_primary) {
- echo plc_delete_link_button('node_networks.php?id=' . $nn_id . '&delete=1&submitted=1', '\\nNode Network ' . $nn_ip);
+ echo plc_delete_link_button('interfaces.php?id=' . $nn_id . '&delete=1&submitted=1', '\\nNode Network ' . $nn_ip);
} else {
echo '<span title="This node network is primary"> P </span>';
}
}
echo "<td class='list_set'>";
if( $is_admin || $is_pi || $is_tech ) {
- echo "<a href='node_networks.php?id=$nn_id'>$nn_ip</a>";
+ echo "<a href='interfaces.php?id=$nn_id'>$nn_ip</a>";
} else {
echo "</td><td class='list_set'>$nn_ip</td>";
}
echo "<p><span class='plc-warning'>No Node Network</span>. Please add a node network to make this a usable PLC node</p>.\n";
}
- echo "<br /><a href='node_networks.php?node_id=$node_id'>Add a node network</a>.\n";
+ echo "<br /><a href='interfaces.php?node_id=$node_id'>Add a node network</a>.\n";
echo "<br /><hr />\n";
}
$has_primary= 0;
if( count($return) > 0 ) {
- foreach( $return as $node_network_detail ) {
- if( $node_network_detail['is_primary'] == true ) {
+ foreach( $return as $interface_detail ) {
+ if( $interface_detail['is_primary'] == true ) {
$has_primary= 1;
break;
}
$fields= array("method","ip");
foreach( $fields as $field ) {
- if( $node_network_detail[$field] == "" ) {
+ if( $interface_detail[$field] == "" ) {
$can_gen_config= 0;
- $node_network_detail[$field]= "<i>Missing</i>";
+ $interface_detail[$field]= "<i>Missing</i>";
}
}
- if( $node_network_detail['method'] == "static" ) {
+ if( $interface_detail['method'] == "static" ) {
$fields= array("gateway","netmask","network","broadcast","dns1");
foreach( $fields as $field ) {
- if( $node_network_detail[$field] == "" ) {
+ if( $interface_detail[$field] == "" ) {
$can_gen_config= 0;
- $node_network_detail[$field]= "<i>Missing</i>";
+ $interface_detail[$field]= "<i>Missing</i>";
}
}
}
- if( $node_network_detail['method'] != "static"
- && $node_network_detail['method'] != "dhcp" ) {
+ if( $interface_detail['method'] != "static"
+ && $interface_detail['method'] != "dhcp" ) {
$can_gen_config= 0;
- $node_network_detail['method']= "<i>Unknown method</i>";
+ $interface_detail['method']= "<i>Unknown method</i>";
}
}
print( "<tr><th>Hostname:</th>" );
print( "<td>" . $node_detail['hostname'] . "</td></tr>\n" );
- $nn_id = $node_network_detail['interface_id'];
- print( "<tr><th colspan=2><a href='node_networks.php?id=$nn_id'>Node Network Details</a></th></tr>" );
+ $nn_id = $interface_detail['interface_id'];
+ print( "<tr><th colspan=2><a href='interfaces.php?id=$nn_id'>Node Network Details</a></th></tr>" );
print( "<tr><th>Method:</th>" );
- print( "<td>" . $node_network_detail['method'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['method'] . "</td></tr>\n" );
print( "<tr><th>IP:</th>" );
- print( "<td>" . $node_network_detail['ip'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['ip'] . "</td></tr>\n" );
- if( $node_network_detail['method'] == "static" ) {
+ if( $interface_detail['method'] == "static" ) {
print( "<tr><th>Gateway:</th>" );
- print( "<td>" . $node_network_detail['gateway'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['gateway'] . "</td></tr>\n" );
print( "<tr><th>Network mask:</th>" );
- print( "<td>" . $node_network_detail['netmask'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['netmask'] . "</td></tr>\n" );
print( "<tr><th>Network address:</th>" );
- print( "<td>" . $node_network_detail['network'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['network'] . "</td></tr>\n" );
print( "<tr><th>Broadcast address:</th>" );
- print( "<td>" . $node_network_detail['broadcast'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['broadcast'] . "</td></tr>\n" );
print( "<tr><th>DNS 1:</th>" );
- print( "<td>" . $node_network_detail['dns1'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['dns1'] . "</td></tr>\n" );
print( "<tr><th>DNS 2:</th>" );
- if( $node_network_detail['dns2'] == "" ) {
+ if( $interface_detail['dns2'] == "" ) {
print( "<td><i>Optional, missing</i></td></tr>\n" );
} else {
- print( "<td>" . $node_network_detail['dns2'] . "</td></tr>\n" );
+ print( "<td>" . $interface_detail['dns2'] . "</td></tr>\n" );
}
}
if (method_exists ($api,'GetInterfaceSettings')) {
- print ("<tr><th colspan=2><a href='node_networks.php?id=$nn_id'>Additional Settings</a></th></tr>\n");
- $nn_id = $node_network_detail['interface_id'];
+ print ("<tr><th colspan=2><a href='interfaces.php?id=$nn_id'>Additional Settings</a></th></tr>\n");
+ $nn_id = $interface_detail['interface_id'];
$settings=$api->GetInterfaceSettings(array("interface_id" => array($nn_id)));
foreach ($settings as $setting) {
$category=$setting['category'];