registerFunction("getDevMaps"); session_start(); $user = $_SESSION['user']; $in_xAjax = false; $xAjax_objResponse; include('IOB_inc.htm'); include('common_admin_inc.htm'); // Note: This must be here to beable to use the error_handler class CBDevice { var $id; var $deviceId; var $bladeId; var $mapped; var $in_lun; var $ex_lun; var $desc; var $type; var $sn; var $wwpn; var $portId; var $vendor; var $product; function CBDevice($id, $deviceId, $bladeId, $mapped, $in_lun, $ex_lun, $desc, $type, $sn, $wwpn, $portId, $vendor, $product) { $this->id = $id; $this->deviceId = $deviceId; $this->bladeId = $bladeId; $this->mapped = $mapped; $this->in_lun = $in_lun; $this->ex_lun = $ex_lun; $this->desc = $desc; $this->type = $type; $this->sn = $sn; $this->wwpn = $wwpn; $this->portId = $portId; $this->vendor = $vendor; $this->product = $product; } }; // The php function that is called from JavaScript tough xAjax when the user selects a Host and presses apply. function getDevMaps($aHostId, $aHostName, $aBladeLoc) { global $IOB_DevTypes; global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; $devices = get_device_maps_by_host($user, $aHostId); error_log("devices for Host($aHostId) = ". print_r($devices,true) ); $i = 0; $theContent = ''; $allContent = ''; foreach( $devices as $device ) { // Fix any 2048 values that come by. if( $device->ex_lun > 255 ) $device->ex_lun = 1; // Fix any NonMapped values that come by. if( ! $device->mapped ) $device->ex_lun = -1; $checked = $device->mapped ? 'CHECKED' : ''; $disabled = $device->mapped ? '' : 'DISABLED'; $theContent = '' . '' . '' . '
' . '' . '' . ''.$device->desc.'' . '' . ''.$IOB_DevTypes[$device->type].'' . '' . ''.$device->sn.'' . '' . ''.$device->vendor.'' . '' . ''.$device->product.'' . '' . '' . '
'; $allContent .= $theContent; $i++; } // Save the Number of Maps for the global count $xAjax_objResponse->assign("numMaps", "value", $i ); $xAjax_objResponse->assign("hostNameSpan", "innerHTML", $aHostName ); $xAjax_objResponse->assign("bladeLocSpan", "innerHTML", $aBladeLoc ); // error_log("\n\n\n=========================================================\n\n\n"); // error_log("allContent = ". $allContent ); // Now Display the devices for this host $xAjax_objResponse->assign("devMapSpan", "innerHTML", $allContent ); // Some Debug examples // $xAjax_objResponse->script('alert(xajax.$("testlevel[1]").value);'); // $xAjax_objResponse->script('alert(xajax.viewSource());'); $in_xAjax = false; return $xAjax_objResponse; } $xajax->processRequest(); /*******************************************************************************************/ // Handle the progress screen if opened and get the NEW data if ($_SERVER[REQUEST_METHOD] == "POST") { $operationInProgress = true; $status = new ReturnStatus(); error_log("_POST = ". print_r($_POST, true) ); // Create the Device Maps to send to the extension. $theDeviceMaps = array(); for( $i=0; $i < $_POST['numMaps']; $i++ ) { if(isset($_POST['lun'.$i])) { error_log("In Loop for ". $_POST['lun'.$i]); if(isset($_POST['devMap'.$i])) $b = (bool)$_POST['devMap'.$i]; else $b = false; $theLun = (int)$_POST['lun'.$i]; if($theLun < 0 ) // Handle the NON-Mapped ones that were set to -1 $theLun = 0; // This value Just needs to be valid. It will be convert back to 2048 in the CMI code. $theDeviceMaps[] = new CBDevMap($theLun, $b); } } error_log("The devMaps passed will be: ". print_r($theDeviceMaps, true) ); update_device_map($user, $_POST['hostId'], $theDeviceMaps ); print $status->out(); return; } $hosts = get_blade_hosts($user); error_log("Hosts = " . print_r($hosts, true) ); $numHosts = sizeof($hosts); $bEnableHostMapping = get_host_mapping_enabled($user); ?> printJavascript(); ?> Blade Host Mapping
Setup - Blade Host Mapping
Configure the Blade Host Mapping.


No blades were found in the library.