- // ACTION: prompt-update
- // from former node_update.php
- case "prompt-update":
-
- require_once('plc_drupal.php');
- $node_info= $api->GetNodes( array( $node_id ), array( "hostname", "model" ) );
- drupal_set_title("Updating " . $node_info[0]['hostname']);
- include 'plc_header.php';
-
- // start form
- echo "<form method=post action='node_actions.php'>\n";
- echo "<input type=hidden name='node_id' value='$node_id'></input>\n";
- echo "<input type=hidden name='action' value='update'></input>\n";
- if( $_POST['error'] ) plc_error(unserialize( $_POST['error']));
- echo "<p><table cellpadding=2><tbody>\n
- <tr><th>Hostname: </th><td> <input type=text size=35 name='hostname' value='". $node_info[0]['hostname'] ."'></td></tr>\n
- <tr><th>Model: </th><td> <input type=text size=35 name='model' value='". $node_info[0]['model'] ."'></td></tr>\n
- </tbody></table>\n
- <p><input type=submit value='Update Node'>\n
- </form>\n";
-
- echo "<p><a href='index.php?id=$node_id'>Back to Node</a>\n";
-
- break;
-
- // ACTION: update
- // from former node_actions.php
- case "update":
-
- $hostname= $_POST['hostname'];
- $model= $_POST['model'];
-
- $fields= array( "hostname"=>$hostname, "model"=>$model );
- $api->UpdateNode( intval( $node_id ), $fields );
- $error= $api->error();
-
- if( empty( $error ) ) {
- plc_redirect(l_node($node_id));
- } else {
- echo "<font color=red>". $error . "</font>\n" ;
- echo "<p> Press back to retry</p>";
- }
-
- break;
-
- // ACTION: delete
- // from former node_actions.php
- case "delete":
- $api->DeleteNode( intval( $node_id ) );
- plc_redirect(l_nodes());
- break;
-
- // ACTION: boot-state
- // from former node_actions.php
- case "boot-state":
- switch( $_POST['boot_state'] ) {
- case 'boot':
- case 'dbg':
- case 'inst':
- case 'rins':
- case 'rcnf':
- case 'new':
- $api->UpdateNode( intval( $node_id ), array( "boot_state" => $_POST['boot_state'] ) );
- plc_redirect (l_node($node_id));
- break;
- default:
- print "<div class='plc-error'> no such boot state " . $_POST['boot_state'] . "</div>";
- break;
- }
- break;
-
- // ACTION: download-generic