//------------------------------------------------------------------------------ // Licensed Materials - Property of IBM // (c) Copyright IBM Corporation 2001,2002 All Rights Reserved. // US Government Users Restricted Rights - Use, duplication or disclosure // restricted by GSA ADP Schedule Contract with IBM Corp. //------------------------------------------------------------------------------ // Set EEB background process // // Filename: ml_set_eeb_background_process.htm // // This page updates settings for the EEB. // // When a POST is operation result information is retrieved from POST // data and displayed in the Message Box. // // // Input: POST data // url original request page // operation Operation to perform on the EEB. // bladeID ID of the EEB. // // Ouput: POST ('form_out') // url original request page // errorCode result of operation // Message message flag = message in POST data // returnMessage text information about the operation results // // // Change History: // // Date Defect Changed By Description of Change // ---- ------ ---------- --------------------- // 07/25/2012 dagalleg File Created //------------------------------------------------------------------------------ include('user_inc.htm'); if($_SERVER[REQUEST_METHOD]=='POST') { $url = $_REQUEST['url']; $theOps = $_POST['operation']; $theBlades = $_POST['bladeID']; //Extract information into seperate strings $blades = explode(":", $theBlades); $operations = explode(":", $theOps); //Get the total operations to perform $count = count($blades); $operation_performed = ""; error_log("\n\nPost Values: \nBlades ID ".print_r($blades, true)."\nOperations ".print_r($operations,true)); for($x=0; $x < $count; $x++ ) { error_log("Doing operation ". $operations[$x] ." on blade id: ".$blades[$x]); switch( $operations[$x] ) { case 'op_powercycle': power_cycle_blade( $user, $blades[$x] ); $operation_performed = "power cycled."; break; case 'op_poweron': set_blade_power( $user, $blades[$x], true ); $operation_performed = "powered on."; break; case 'op_poweroff': set_blade_power( $user, $blades[$x], false ); $operation_performed = "powered off."; break; case 'op_remove': remove_blade( $user, $blades[$x] ); $operation_performed = "been removed."; break; } error_log("Finished operation ". $operations[$x] ." on blade id: ".$blades[$x]); } $returnMessage = "The ethernet expansion blade has succesfully "; if($count > 1) $returnMessage = "The ethernet expansion blades have succesfully "; $returnMessage.=$operation_performed; } ?>