- $nodenetworks= $api->GetNodeNetworks( array( $id ) );
- if( $nodenetworks ) {
- $nodenetwork= $nodenetworks[0];
- $node_id= $nodenetwork['node_id'];
+ $interfaces= $api->GetInterfaces( array( $id ) );
+ if( $interfaces ) {
+ $interface= $interfaces[0];
+ $node_id= $interface['node_id'];
foreach( array( 'method', 'type', 'ip', 'gateway', 'network', 'broadcast', 'netmask', 'dns1', 'dns2', 'hostname', 'mac', 'bwlimit', 'node_id' ) as $field ) {
if( isset( $_POST[$field] ) ) {
if( $_POST[$field] == "" ) {
foreach( array( 'method', 'type', 'ip', 'gateway', 'network', 'broadcast', 'netmask', 'dns1', 'dns2', 'hostname', 'mac', 'bwlimit', 'node_id' ) as $field ) {
if( isset( $_POST[$field] ) ) {
if( $_POST[$field] == "" ) {
- if( isset( $nodenetwork[$field] ) ) {
- // E.g., $method = $nodenetwork['method'];
- $$field= $nodenetwork[$field];
+ if( isset( $interface[$field] ) ) {
+ // E.g., $method = $interface['method'];
+ $$field= $interface[$field];
if( !isset( $_GET['node_id'] ) && !( $nodes= $api->GetNodes( array( intval($node_id) ), array( 'node_id', 'hostname', 'site_id' ) ) ) ) {
Header( "Location: index.php" );
exit();
if( !isset( $_GET['node_id'] ) && !( $nodes= $api->GetNodes( array( intval($node_id) ), array( 'node_id', 'hostname', 'site_id' ) ) ) ) {
Header( "Location: index.php" );
exit();
if( $can_update && (isset( $_POST['submitted'] ) || isset ($_GET['submitted'])) ) {
if( isset( $_POST['add'] ) ) {
if( $can_update && (isset( $_POST['submitted'] ) || isset ($_GET['submitted'])) ) {
if( isset( $_POST['add'] ) ) {
if( !isset( $id ) ) {
Header( "Location: index.php?id=$node_id" );
exit();
}
if( isset( $_POST['delete'] ) || isset ($_GET['delete']) ) {
if( !isset( $id ) ) {
Header( "Location: index.php?id=$node_id" );
exit();
}
if( isset( $_POST['delete'] ) || isset ($_GET['delete']) ) {
$is_admin=in_array( 10, $_roles );
$is_pi=in_array( 20, $_roles );
print "<hr />";
$is_admin=in_array( 10, $_roles );
$is_pi=in_array( 20, $_roles );
print "<hr />";
print "<p> This network interface has no additional setting</p>";
if( $is_admin || $is_pi )
echo "<p><a href='settings.php?add=$id'>Add a Network Setting</a></p>\n";
} else {
print "<p> This network interface has no additional setting</p>";
if( $is_admin || $is_pi )
echo "<p><a href='settings.php?add=$id'>Add a Network Setting</a></p>\n";
} else {
- $nodenetwork_settings = $api->GetNodeNetworkSettings($nodenetwork['nodenetwork_setting_ids']);
- sort_nodenetwork_settings ($nodenetwork_settings);
+ $interface_settings = $api->GetInterfaceSettings($interface['interface_setting_ids']);
+ sort_interface_settings ($interface_settings);
print "<table cellpadding='5' cellspacing='5' class='list_set'><caption class='list_set'>Additional Settings</caption>";
print "<thead><tr class='list_set'>";
// the column for the delete button
if( $is_admin )
print "<th></th>";
print "<th class='list_set'>Name</th><th class='list_set'>Category</th><th class='list_set'>Description</th><th class='list_set'>Value</th></tr></thead><tbody>";
print "<table cellpadding='5' cellspacing='5' class='list_set'><caption class='list_set'>Additional Settings</caption>";
print "<thead><tr class='list_set'>";
// the column for the delete button
if( $is_admin )
print "<th></th>";
print "<th class='list_set'>Name</th><th class='list_set'>Category</th><th class='list_set'>Description</th><th class='list_set'>Value</th></tr></thead><tbody>";
- printf ("<td class='list_set'> <a href='settings.php?id=%s'>%s </a></td>",$setting['nodenetwork_setting_id'],$setting['name']);
+ printf ("<td class='list_set'> <a href='settings.php?id=%s'>%s </a></td>",$setting['interface_setting_id'],$setting['name']);
else
printf ("<td class='list_set'> %s </td>",$setting['name']);
printf ("<td class='list_set'> %s</td><td class='list_set'> %s</td><td class='list_set'> %s </td></tr>",
else
printf ("<td class='list_set'> %s </td>",$setting['name']);
printf ("<td class='list_set'> %s</td><td class='list_set'> %s</td><td class='list_set'> %s </td></tr>",