From: Stephen Soltesz Date: Tue, 2 Jun 2009 18:05:27 +0000 (+0000) Subject: added images to make this an all-in-one package. X-Git-Tag: www-register-wizard-4.2-4~2 X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=commitdiff_plain;h=d557c8eaf9a4a4f041672b7e5adb0fae9c7184a9 added images to make this an all-in-one package. updated register to handle cases when the node already exists by forcing user to assign pcu to node. update download with new boot states update confirm to report errors correctly on failed API call. view enhancements. disabled floppy/generic iso as an option. --- diff --git a/application/controllers/confirm.php b/application/controllers/confirm.php index 83fe71c..dfd0184 100644 --- a/application/controllers/confirm.php +++ b/application/controllers/confirm.php @@ -11,7 +11,6 @@ include 'plc_header.php'; // Common functions require_once 'plc_functions.php'; -require_once 'plc_sorts.php'; include 'plc_objects.php'; @@ -164,12 +163,12 @@ class Confirm extends Controller { { global $api, $plc; $hostname = $data['node_id']; - $api->UpdateNode( $hostname, array( "boot_state" => 'rins') ); + $api->UpdateNode( $hostname, array( "boot_state" => 'reinstall') ); $ret = $api->RebootNodeWithPCU( $hostname ); if ( "$ret" != "0" ) { - $data['error'] = $ret; - } else { $data['error'] = $api->error(); + } else { + $data['error'] = $ret; } } } diff --git a/application/controllers/download.php b/application/controllers/download.php index 06e1737..fa64938 100644 --- a/application/controllers/download.php +++ b/application/controllers/download.php @@ -11,7 +11,6 @@ include 'plc_header.php'; // Common functions require_once 'plc_functions.php'; -require_once 'plc_sorts.php'; include 'plc_objects.php'; @@ -108,7 +107,7 @@ class Download extends Controller { $basename=PLC_NAME."-BootCD.usb"; } - $api->UpdateNode( $hostname, array( "boot_state" => 'disable', + $api->UpdateNode( $hostname, array( "boot_state" => 'disabled', "version" => $this->get_bootcd_version() ) ); /* exits on success */ $success = $this->deliver_bootmedium($node_id, $boot_action, $basename); @@ -140,7 +139,7 @@ class Download extends Controller { } $hostname= $node_detail['hostname']; - $return= $api->GetNodeNetworks( array( "node_id" => $node_id ), NULL ); + $return= $api->GetInterfaces( array( "node_id" => $node_id ), NULL ); $can_gen_config= 1; $data['has_primary']= 0; @@ -216,7 +215,7 @@ class Download extends Controller { } if ($action != 'download-node-floppy') { - $api->UpdateNode( $hostname, array( "boot_state" => 'disable', + $api->UpdateNode( $hostname, array( "boot_state" => 'disabled', "version" => $this->get_bootcd_version() ) ); } /* exits on success */ diff --git a/application/controllers/register.php b/application/controllers/register.php index 0334251..242d860 100644 --- a/application/controllers/register.php +++ b/application/controllers/register.php @@ -11,7 +11,7 @@ include 'plc_header.php'; // Common functions require_once 'plc_functions.php'; -require_once 'plc_sorts.php'; +//require_once 'plc_sorts.php'; include 'plc_objects.php'; @@ -117,11 +117,12 @@ class Register extends Controller { global $api, $plc; // get sites depending on role and sites associated. if( $person->isAdmin() ) { - $site_info= $api->GetSites( NULL, array( "name", "site_id", "login_base" ) ); + $site_info= $api->GetSites(array('peer_id' => NULL,'-SORT'=>'name'), + array( "name", "site_id", "login_base" ) ); } else { $site_info= $api->GetSites( $person->getSites(), array( "name", "site_id", "login_base" ) ); } - sort_sites( $site_info ); + //sort_sites( $site_info ); return $site_info; } @@ -385,8 +386,8 @@ class Register extends Controller { } } - $nodenetwork_id= $api->AddNodeNetwork( $node_id, $optional_vals); - if( $nodenetwork_id <= 0 ) { + $interface_id= $api->AddInterface( $node_id, $optional_vals); + if( $interface_id <= 0 ) { $data['error'] = $api->error(); print $data['error']; } @@ -480,14 +481,20 @@ class Register extends Controller { print $this->validation->error_string . "
"; } - $data['node'] = $this->getnode($data['node_id']); - $api_pcus = $api->GetPCUs($data['node']->pcu_ids); - $pcu = $api_pcus[0]; + if ( sizeof($data['node']->pcu_ids) == 0) + { + $data['pcu_assigned'] = False; + $data['pcu_port'] = -1; + } else { + $data['pcu_assigned'] = True; + $api_pcus = $api->GetPCUs($data['node']->pcu_ids); + $pcu = $api_pcus[0]; + # NOTE: find index of node id, then pull out that index of + $index = array_search($data['node_id'], $pcu['node_ids']); + $data['pcu_port'] = $pcu['ports'][$index]; + } - # NOTE: find index of node id, then pull out that index of - $index = array_search($data['node_id'], $pcu['node_ids']); - $data['pcu_port'] = $pcu['ports'][$index]; $data['stage'] = 4.5; #$data = $this->get_stage4_data($person, $data); $this->load->view('header', $data); @@ -673,7 +680,7 @@ class Register extends Controller { if ( count($optional_vals) > 0 ) { print_r($optional_vals); - $ret = $api->UpdateNodeNetwork( $node_obj->nodenetwork_id, $optional_vals); + $ret = $api->UpdateInterface( $node_obj->interface_id, $optional_vals); if( $ret <= 0 ) { $data['error'] = $api->error(); print $data['error']; diff --git a/application/views/stage1_pcu_choose.php b/application/views/stage1_pcu_choose.php index ff4845c..5a279b5 100644 --- a/application/views/stage1_pcu_choose.php +++ b/application/views/stage1_pcu_choose.php @@ -51,6 +51,8 @@ + + ERROR:No sites returned... Model: diff --git a/application/views/stage45_pcuport.php b/application/views/stage45_pcuport.php index e076a59..5b25bcb 100644 --- a/application/views/stage45_pcuport.php +++ b/application/views/stage45_pcuport.php @@ -15,6 +15,7 @@ if( isset($errors) && count($errors) > 0 ) Please confirm that the node is associated with the correct port on the PCU. Most newer models have this function built-in, where as older models allow for multiple 'ports'. Port 1 is appropriate for built-in models. + 'post')) ?>
@@ -23,6 +24,7 @@ multiple 'ports'. Port 1 is appropriate for built-in models.
+
diff --git a/application/views/stage5_bootimage.php b/application/views/stage5_bootimage.php index 919e458..1583d60 100644 --- a/application/views/stage5_bootimage.php +++ b/application/views/stage5_bootimage.php @@ -16,29 +16,30 @@ function updateContinueEnabled() - - + - + - +
All-In-One ISO image. + All-In-One ISO image. Includes plnode.txt. No additional formatting required.
All-In-One USB image. Includes plnode.txt, and filesystem only. Requires additional USB stick formatting.**All-In-One USB image. Includes plnode.txt, and filesystem only. Requires additional USB stick formatting.**
All-In-One partitioned, USB image. Includes, plnode.txt, MBR, partition table, and filesystem. No additional formatting required.**All-In-One partitioned, USB image. Includes, plnode.txt, MBR, partition table, and filesystem. No additional formatting required.**
+

Additional directions are provided on the next page.

-

NOTE: ** USB images are not guaranteed to work on all systems.

+

NOTE: ** USB images are not guaranteed to work on all systems or with all USB memory sticks.

diff --git a/application/views/stage8_rebootpcu.php b/application/views/stage8_rebootpcu.php index c5c26ea..dd0cf71 100644 --- a/application/views/stage8_rebootpcu.php +++ b/application/views/stage8_rebootpcu.php @@ -2,15 +2,15 @@

Confirm Reboot Node With PCU

- +
Step 1
- Use the 'Test Reboot' button. This will set the boot state to 'rins' and + Use the 'Test Reboot' button. This will set the boot state to 'reinstall' and attempt to reboot your machine using the registered PCU.
- +
If Reboot fails,
there will be an error displayed that will assist you in @@ -52,7 +52,7 @@ Start with the 'Test Reboot' button. - +
'Test Reboot' to start again.
'Reload' to Reload this page. diff --git a/images/all-in-one-cd.png b/images/all-in-one-cd.png new file mode 100644 index 0000000..dcbc661 Binary files /dev/null and b/images/all-in-one-cd.png differ diff --git a/images/all-in-one-usb.png b/images/all-in-one-usb.png new file mode 100644 index 0000000..7f05d86 Binary files /dev/null and b/images/all-in-one-usb.png differ