From: Thierry Parmentelat Date: Tue, 27 May 2008 07:46:40 +0000 (+0000) Subject: for 5.0 X-Git-Tag: PLEWWW-PLE.5.0-0~12 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=26e306ad899802a8e41fd6b5469cde4f506e6553;p=plewww.git for 5.0 --- diff --git a/planetlab/nodes/index.php b/planetlab/nodes/index.php index 91aeaa1..355ade4 100644 --- a/planetlab/nodes/index.php +++ b/planetlab/nodes/index.php @@ -248,7 +248,7 @@ if ( $_GET['id'] ) { // 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 ) ) @@ -381,7 +381,7 @@ if ( $_GET['id'] ) { echo "
\n"; // display node networks - if( $node_networks ) { + if( $interfaces ) { echo "

\n"; echo "\n"; echo ""; @@ -391,27 +391,27 @@ if ( $_GET['id'] ) { } echo "\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 ""; if ( $is_admin || ($is_pi && $in_site)) { echo ""; } @@ -432,7 +432,7 @@ if ( $_GET['id'] ) { echo "

No Node Network. Please add a node network to make this a usable PLC node

.\n"; } - echo "
Add a node network.\n"; + echo "
Add a node network.\n"; echo "

\n"; } diff --git a/planetlab/nodes/node_networks.php b/planetlab/nodes/interfaces.php similarity index 99% rename from planetlab/nodes/node_networks.php rename to planetlab/nodes/interfaces.php index 50e38b2..f8b7f58 100644 --- a/planetlab/nodes/node_networks.php +++ b/planetlab/nodes/interfaces.php @@ -100,7 +100,7 @@ drupal_set_title($node['hostname']); include 'plc_header.php'; // Start form -$action= "node_networks.php"; +$action= "interfaces.php"; if( isset( $id ) ) { $action.= "?id=" . $interface['interface_id']; } diff --git a/planetlab/nodes/node_actions.php b/planetlab/nodes/node_actions.php index 3844031..0878874 100644 --- a/planetlab/nodes/node_actions.php +++ b/planetlab/nodes/node_actions.php @@ -278,8 +278,8 @@ switch ($action) { $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; } @@ -296,26 +296,26 @@ switch ($action) { $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]= "Missing"; + $interface_detail[$field]= "Missing"; } } - 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]= "Missing"; + $interface_detail[$field]= "Missing"; } } } - 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']= "Unknown method"; + $interface_detail['method']= "Unknown method"; } } @@ -395,36 +395,36 @@ if( $has_primary ) { print( "" ); print( "\n" ); - $nn_id = $node_network_detail['interface_id']; - print( "" ); + $nn_id = $interface_detail['interface_id']; + print( "" ); print( "" ); - print( "\n" ); + print( "\n" ); print( "" ); - print( "\n" ); + print( "\n" ); - if( $node_network_detail['method'] == "static" ) { + if( $interface_detail['method'] == "static" ) { print( "" ); - print( "\n" ); + print( "\n" ); print( "" ); - print( "\n" ); + print( "\n" ); print( "" ); - print( "\n" ); + print( "\n" ); print( "" ); - print( "\n" ); + print( "\n" ); print( "" ); - print( "\n" ); + print( "\n" ); print( "" ); - if( $node_network_detail['dns2'] == "" ) { + if( $interface_detail['dns2'] == "" ) { print( "\n" ); } else { - print( "\n" ); + print( "\n" ); } } if (method_exists ($api,'GetInterfaceSettings')) { - print ("\n"); - $nn_id = $node_network_detail['interface_id']; + print ("\n"); + $nn_id = $interface_detail['interface_id']; $settings=$api->GetInterfaceSettings(array("interface_id" => array($nn_id))); foreach ($settings as $setting) { $category=$setting['category']; diff --git a/planetlab/nodes/setting_action.php b/planetlab/nodes/setting_action.php index 8dbe20c..41e852d 100644 --- a/planetlab/nodes/setting_action.php +++ b/planetlab/nodes/setting_action.php @@ -72,7 +72,7 @@ if( $_GET['rem_id'] ) { // delete the attribute $api->DeleteInterfaceSetting( $setting_id ); - header( "location: node_networks.php?id=$interface_id" ); + header( "location: interfaces.php?id=$interface_id" ); exit(); } @@ -86,7 +86,7 @@ if( $_POST['add_setting'] ) { // add it! $api->AddInterfaceSetting( $interface_id, $interface_setting_type_id, $value ); - header( "location: node_networks.php?id=$interface_id" ); + header( "location: interfaces.php?id=$interface_id" ); exit(); } @@ -100,7 +100,7 @@ if( $_POST['edit_setting'] ) { // update it! $api->UpdateInterfaceSetting($setting_id, $value ); - header( "location: node_networks.php?id=$interface_id" ); + header( "location: interfaces.php?id=$interface_id" ); exit(); }
Node Networks
IP AddressMethodTypeMACBandwidth Limit
"; 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 ' P '; } @@ -419,7 +419,7 @@ if ( $_GET['id'] ) { } echo ""; if( $is_admin || $is_pi || $is_tech ) { - echo "$nn_ip"; + echo "$nn_ip"; } else { echo "$nn_ip
Hostname:" . $node_detail['hostname'] . "
Node Network Details
Node Network Details
Method:" . $node_network_detail['method'] . "
" . $interface_detail['method'] . "
IP:" . $node_network_detail['ip'] . "
" . $interface_detail['ip'] . "
Gateway:" . $node_network_detail['gateway'] . "
" . $interface_detail['gateway'] . "
Network mask:" . $node_network_detail['netmask'] . "
" . $interface_detail['netmask'] . "
Network address:" . $node_network_detail['network'] . "
" . $interface_detail['network'] . "
Broadcast address:" . $node_network_detail['broadcast'] . "
" . $interface_detail['broadcast'] . "
DNS 1:" . $node_network_detail['dns1'] . "
" . $interface_detail['dns1'] . "
DNS 2:Optional, missing
" . $node_network_detail['dns2'] . "
" . $interface_detail['dns2'] . "
Additional Settings
Additional Settings