//------------------------------------------------------------------------------ // 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. //------------------------------------------------------------------------------ // Modify Logical Library // // Filename: ml_loglib_modify_lib.htm // // This file displays handles logical library modify requests. // // When a POST is received, POST data is retrieved and the appropriate // extension is called. Return information is sent via a POST (form_out). // // Input: POST data // url original request page // libName logical library name // emulationType emulation type // barcodePolicy barcode format policy // autoClean automatic drive cleaning setting // drives drive guids // slotCount number of storage slots // // Ouput: POST ('form_out') // // url original request page // errorCode result of operation // returnMessage text information about the operation results // // Change History: // // Date Defect Changed By Description of Change // ---- ------ ---------- --------------------- // 12/20/2005 rwinston File Created // 09/24/2012 1829 dagalleg Add SNMP audit logging. // //------------------------------------------------------------------------------ include('common_admin_inc.htm'); include('main_inc.htm'); //initialize variables $errorCode = 0; $returnMessage = " "; $url = " " ; if ($_SERVER['REQUEST_METHOD'] == "POST") { $url = $_REQUEST['url']; $libName = $_REQUEST['libName']; $libGuid = $_REQUEST['libGuid']; $emulationType = $_REQUEST['emulationType']; $barcodePolicy = $_REQUEST['barcodePolicy']; $autoClean = $_REQUEST['autoClean']; $drives = split(":",$_REQUEST['driveGuids']); $slotCount = $_REQUEST['slotCount']; error_log("modify_logical_library($user, $libGuid, $libName, (int)$emulationType,$barcodePolicy, (int)$autoClean, ".$_REQUEST['driveGuids'].", $slotCount)"); // need empty slot count $lib = get_logical_library($user,$libGuid); $empty_slot_count = $lib->totalSlots - $lib->fullSlots; // if trying to decrease the number of slots in the partition, verify there are enough empty slots. $slot_count_change=0; if ($slotCount < $lib->totalSlots) { $slot_count_change=$lib->totalSlots - $slotCount; } if ( ($empty_slot_count < $slot_count_change) && ($slotCount < $lib->totalSlots) ) { $errorCode = 52009; $returnMessage = "Modify logical library failed. There are not enough empty slots to satisfy the request. Please remove media from the logical library. "; } else { modify_logical_library($user, $libGuid, $libName, (int)$emulationType,$barcodePolicy, (int)$autoClean, $drives, $slotCount); if(get_snmp_audit_logging_enabled($user) == '1') { error_log("send_snmp_audit_logging_partition_config_changed_trap"); send_snmp_audit_logging_partition_config_changed_trap($user, $libName, "A logical library configuration setting has been changed from the Web UI"); } $returnMessage = "Modify Logical Library Complete."; } } ?>