From d557c8eaf9a4a4f041672b7e5adb0fae9c7184a9 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Tue, 2 Jun 2009 18:05:27 +0000 Subject: [PATCH] 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. --- application/controllers/confirm.php | 7 +++--- application/controllers/download.php | 7 +++--- application/controllers/register.php | 31 +++++++++++++++--------- application/views/stage1_pcu_choose.php | 2 ++ application/views/stage45_pcuport.php | 2 ++ application/views/stage5_bootimage.php | 13 +++++----- application/views/stage8_rebootpcu.php | 8 +++--- images/all-in-one-cd.png | Bin 0 -> 1872 bytes images/all-in-one-usb.png | Bin 0 -> 1917 bytes 9 files changed, 40 insertions(+), 30 deletions(-) create mode 100644 images/all-in-one-cd.png create mode 100644 images/all-in-one-usb.png 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 0000000000000000000000000000000000000000..dcbc66168e3bc4e8465506fe9186149d55a60ebe GIT binary patch literal 1872 zcmV-W2e0^vP)zn21q~Zf24>_nPw017-Ng@^VNisVlicrO zQr%NspZYzkn`4Z@|4-zPGfdMQ9v&VU85tQFDHIBX5XKm#w7R;wxw(1!_U$b#E&mwL ztziAs)KoH=oSvR;YHHfCV~3(Bk|gmw4*;&~nx;8AI{M+mhw<_8ty{MqJa|wP#eWU| z@ZrPn-@kWtbu~9Pue=0f?Dgx{FJ8PzBoc{4Vr_i3OtZ7I=g*%X7#P4yN~!C*j^ntl ziv!!XZQJ(l;55f^Zr{Fr_3G8-3$CC_d?u5*aN$Baoo0+#mSvizZQGV*c}UB$bX_-1 z(=<)*zHQt1_^Vg1&Ye5wU9JtE&*#scJv%iuRVWlnrIPVecW-Mf!}IgW#i zynFZV;>C-r#Pj8WxOVN@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-n@C!)6=tW-@etb;dfs-U%q_l?d|pXe0%rqt*fiUo~7%0O-)UGeLY%_hl=aE zGcz-TgM-OrG8hbYcXzk7wXKrXhT2rdd5Hi0000< KMNUMnLSTXc522|5 literal 0 HcmV?d00001 diff --git a/images/all-in-one-usb.png b/images/all-in-one-usb.png new file mode 100644 index 0000000000000000000000000000000000000000..7f05d86c553eeca6e01f7f733f4dfde5198d6a87 GIT binary patch literal 1917 zcmV-@2ZH#CP)7-(w? zH8-n`jSZqG?3j7!(xtBoJ9X+54*-n8C!gFl3{%s*T3aZuvr^T_q?Uy{_sbhqKsXlb ziN~XXfNxvAxBd7=)l;>=u)wsyw4iE1)dJH7$Ek}$5YpH;JRfZOyL)%8x3|4S(BJRU z;dYq|!Sf19tvSz_-59pIx%IoVi+AokXlhcA9vumXwc0)-`#iSeAp{5oLct+y^KlrZ zj4{d>V~i2Tf{ORSr!VT6%dPkIMLwI=PmgK>Mhm)Aw5aMsWx}T`C~1UzV)#&aV>ixB zOic5faCCfB(-Z(`kb&m`7`R0OU>D9GDDP@=< zV2m=18D*4lp!j{#izeU!z~d1ZW2I8%=RM|6{^6*yAdA=rRt!X{Q}2h4oP2ckuN}vJ z<{vn86IvcqZP>G{dbV^mdtrxCw~~x8aNj9qg5Uu_ZX~Xy@B(M8=l?uf%@mz^-C5nB zLL?FX{_iUf{?#<{J@e^9{j=*lMrBUA8SI@z&D(f2i`(Qlj;`yLWxeG2{oYck98_cg zP)f^xIc$p@a2R-u%qMrO)dfjW88Is>i{;E5&mj(@f~?iUUeyb`lrbhrk|aqld0kzt z>GV^M!)>i0gm6>g@gL$2&moQjrRPA$kA7EvJfpPrl+s_6p4{g+;5pzpR1e!mrIb=i z2_ckHgpeqT7~_{bRSgsi6~>q>d-v|`U<`Fu(r@=zJVqP_(XZ_J!C9?0w&&PS3+YsL z`eP0w9s>XnLTuZ%ZQF4i$8iWDE`x5iC_@M#gf=!dY}?*)e;m)*wgbR4RXK1VYFji~ zUid{<#ls;U1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