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.
// Common functions
require_once 'plc_functions.php';
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_sorts.php';
include 'plc_objects.php';
include 'plc_objects.php';
{
global $api, $plc;
$hostname = $data['node_id'];
{
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" ) {
$ret = $api->RebootNodeWithPCU( $hostname );
if ( "$ret" != "0" ) {
- $data['error'] = $ret;
- } else {
$data['error'] = $api->error();
$data['error'] = $api->error();
+ } else {
+ $data['error'] = $ret;
// Common functions
require_once 'plc_functions.php';
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_sorts.php';
include 'plc_objects.php';
include 'plc_objects.php';
$basename=PLC_NAME."-BootCD.usb";
}
$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);
"version" => $this->get_bootcd_version() ) );
/* exits on success */
$success = $this->deliver_bootmedium($node_id, $boot_action, $basename);
}
$hostname= $node_detail['hostname'];
}
$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;
$can_gen_config= 1;
$data['has_primary']= 0;
}
if ($action != 'download-node-floppy')
{
}
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 */
"version" => $this->get_bootcd_version() ) );
}
/* exits on success */
// Common functions
require_once 'plc_functions.php';
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_sorts.php';
+//require_once 'plc_sorts.php';
include 'plc_objects.php';
include 'plc_objects.php';
global $api, $plc;
// get sites depending on role and sites associated.
if( $person->isAdmin() ) {
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" ) );
}
} else {
$site_info= $api->GetSites( $person->getSites(), array( "name", "site_id", "login_base" ) );
}
- sort_sites( $site_info );
+ //sort_sites( $site_info );
- $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'];
}
$data['error'] = $api->error();
print $data['error'];
}
print $this->validation->error_string . "<br>";
}
print $this->validation->error_string . "<br>";
}
$data['node'] = $this->getnode($data['node_id']);
$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);
$data['stage'] = 4.5;
#$data = $this->get_stage4_data($person, $data);
$this->load->view('header', $data);
if ( count($optional_vals) > 0 )
{
print_r($optional_vals);
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'];
if( $ret <= 0 ) {
$data['error'] = $api->error();
print $data['error'];
+ <?php else: ?>
+ <tr><th>ERROR:</th><td>No sites returned...</td></tr>
<?php endif; ?>
<tr><th>Model: </th>
<td>
<?php endif; ?>
<tr><th>Model: </th>
<td>
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.
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.
+<?php if ( $pcu_assigned ): ?>
<?= form_open("download/stage5_bootimage/$pcu_id/$site_id/$node_id", array('method'=>'post')) ?>
<center>
<input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
<?= form_open("download/stage5_bootimage/$pcu_id/$site_id/$node_id", array('method'=>'post')) ?>
<center>
<input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
<input type=submit name='node_confirm' value='Confirm & Proceed'>
</center>
</form>
<input type=submit name='node_confirm' value='Confirm & Proceed'>
</center>
</form>
</div>
<br>
<div class="plroundedupdate">
</div>
<br>
<div class="plroundedupdate">
<table style="font-size: 100%">
<tr>
<td><input type='radio' name='action' value='download-node-iso' onchange='updateContinueEnabled();'></td>
<table style="font-size: 100%">
<tr>
<td><input type='radio' name='action' value='download-node-iso' onchange='updateContinueEnabled();'></td>
- <td><img src="/misc/all-in-one-cd.png"/></td><td><b>All-In-One ISO image</b>.
+ <td><img src="/registerwizard/images/all-in-one-cd.png"/></td><td><b>All-In-One ISO image</b>.
Includes plnode.txt. No additional formatting required.</td>
</tr>
<tr>
<td><input type='radio' name='action' value='download-node-usb' onchange='updateContinueEnabled();'></td>
Includes plnode.txt. No additional formatting required.</td>
</tr>
<tr>
<td><input type='radio' name='action' value='download-node-usb' onchange='updateContinueEnabled();'></td>
- <td><img src="/misc/all-in-one-usb.png" /></td><td><b>All-In-One USB image</b>. Includes plnode.txt, and filesystem only. Requires additional USB stick formatting.**</td>
+ <td><img src="/registerwizard/images/all-in-one-usb.png" /></td><td><b>All-In-One USB image</b>. Includes plnode.txt, and filesystem only. Requires additional USB stick formatting.**</td>
</tr>
<tr>
<td><input type='radio' name='action' value='download-node-usb-partition' onchange='updateContinueEnabled();'></td>
</tr>
<tr>
<td><input type='radio' name='action' value='download-node-usb-partition' onchange='updateContinueEnabled();'></td>
- <td><img src="/misc/all-in-one-usb.png" /></td><td><b>All-In-One partitioned, USB image</b>. Includes, plnode.txt, MBR, partition table, and filesystem. No additional formatting required.**</td>
+ <td><img src="/registerwizard/images/all-in-one-usb.png" /></td><td><b>All-In-One partitioned, USB image</b>. Includes, plnode.txt, MBR, partition table, and filesystem. No additional formatting required.**</td>
<td><input type='radio' name='action' value='download-node-floppy-with-iso' onchange='updateContinueEnabled();'></td>
<td><img src="/misc/generic-cd-and-floppy.png" /></td><td><b>Generic CD</b>, and <b>plnode.txt</b> on Floppy</td>
</tr>
<tr>
<td><input type='radio' name='action' value='download-node-floppy-with-usb' onchange='updateContinueEnabled();'></td>
<td><img src="/misc/generic-usb-and-floppy.png" /></td><td><b>Generic USB</b>, and <b>plnode.txt</b> on Floppy</td>
<td><input type='radio' name='action' value='download-node-floppy-with-iso' onchange='updateContinueEnabled();'></td>
<td><img src="/misc/generic-cd-and-floppy.png" /></td><td><b>Generic CD</b>, and <b>plnode.txt</b> on Floppy</td>
</tr>
<tr>
<td><input type='radio' name='action' value='download-node-floppy-with-usb' onchange='updateContinueEnabled();'></td>
<td><img src="/misc/generic-usb-and-floppy.png" /></td><td><b>Generic USB</b>, and <b>plnode.txt</b> on Floppy</td>
<p>Additional directions are provided on the next page.</p>
<p>Additional directions are provided on the next page.</p>
- <p>NOTE: ** USB images are not guaranteed to work on all systems.</p>
+ <p>NOTE: ** USB images are not guaranteed to work on all systems or with all USB memory sticks.</p>
</div>
<center>
<input type=submit name='download_bootimage' disabled value='Select'>
</div>
<center>
<input type=submit name='download_bootimage' disabled value='Select'>
<div class="plroundedwhite">
<h3>Confirm Reboot Node With PCU</h3>
<dl>
<div class="plroundedwhite">
<h3>Confirm Reboot Node With PCU</h3>
<dl>
- <?php if ( $node['boot_state'] == "disable" ): ?>
+ <?php if ( $node['boot_state'] == "disabled" ): ?>
<dt>Step 1</dt>
<dd>
<span class='error'>
<dt>Step 1</dt>
<dd>
<span class='error'>
- 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.
</span>
</dd>
attempt to reboot your machine using the registered PCU.
</span>
</dd>
- <?php elseif ( $node['boot_state'] == "rins" || $node['boot_state'] == "reinstall" ): ?>
+ <?php elseif ( $node['boot_state'] == "reinstall" ): ?>
<?php if ( isset($error) && ! empty($error) ): ?>
<dt>If Reboot fails,</dt><dd>
there will be an error displayed that will assist you in
<?php if ( isset($error) && ! empty($error) ): ?>
<dt>If Reboot fails,</dt><dd>
there will be an error displayed that will assist you in
<td>
<?php if ( $node['boot_state'] == "disable" ): ?>
<span class='error'> Start with the 'Test Reboot' button.</span>
<td>
<?php if ( $node['boot_state'] == "disable" ): ?>
<span class='error'> Start with the 'Test Reboot' button.</span>
- <?php elseif ( $node['boot_state'] == "rins" ): ?>
+ <?php elseif ( $node['boot_state'] == "reinstall" ): ?>
<br>'Test Reboot' to start again.<br>
'Reload' to Reload this page.
<?php else: ?>
<br>'Test Reboot' to start again.<br>
'Reload' to Reload this page.
<?php else: ?>