include('common_admin_inc.htm');
include('dateTime_inc.htm');
$partitionCount = 0;
if (isset($_GET['method']))
{
error_log("$_GET = ". print_r($_GET, true));
$method = $_GET['method'];
if ($method == "applyLicense")
{
$licenseKey = $_POST['licenseKey'];
$success = set_licensed_feature_rs($user, $licenseKey);
$licenseInfo = get_licensed_slot_info($user);
$result = (int)($success && $licenseInfo->success);
echo "";
}
else if ($method == "updateDateTime")
{
$textDate = $_POST['txtDate'];
$timeStamp = strtotime($textDate);
$tvals = getdate($timeStamp);
$dateTime = new DateTime($tvals['year'],$tvals['mon'],$tvals['mday'],
$_POST['hour'],$_POST['minute'],"0",
$_POST['ampm'],$_POST['daySavingsAdjust'],
$_POST['timeZone'],
$_POST[ 'useNTP' ],
$_POST[ 'NTP_1' ],
$_POST[ 'NTP_2' ]);
update_date_and_time($user,$dateTime);
echo '';
}
else if ($method == "updateLibrary")
{
// Required to support the operation in progress dialog.
$operationInProgress = true;
$status = new ReturnStatus();
error_log("_POST = " . print_r($_POST, true) );
$currentCleaning = $_POST['configuredCleaningSize'];
$requestedCleaning = $_POST['numCleaningSlots'];
$currentMailbox = $_POST['configuredMailboxSize'];
$requestedMailbox = $_POST['numMailboxSlots'];
$partitionCount = $_POST['partitionCount'];
$partitionNames = explode(":", $_POST['partitionNames'] );
if ($_POST['defaultConfiguration'] == 1)
{
if ($requestedCleaning > $currentCleaning || $requestedMailbox > $currentMailbox)
{
// we have to delete the current partition to make room for the new request
$libs = get_logical_libraries($user, new SortCriteria());
delete_logical_library($user, $libs[0]->guid);
// If we delete the partition, we'll have one at least
$partitionCount = max(1, $partitionCount);
}
else
{
// If this is a default configuration and there were no changes made to
// cleaning or mailbox, then we don't need to create a partition
$partitionCount = 0;
}
}
if ($requestedCleaning != $currentCleaning)
{
set_num_cleaning_slots($user, $requestedCleaning);
}
if ($requestedMailbox != $currentMailbox)
{
set_num_mailbox_slots($user, $requestedMailbox);
}
if ($partitionCount > 0)
{
error_log("--------------> partitionNames = ". print_r($partitionNames, true) );
error_log("--------------> Calling auto_partition($user, $partitionCount, $partitionNames );" );
auto_partition($user, $partitionCount, $partitionNames );
}
print $status->out();
}
return;
}
// Get the currect logical Library Names so we can match the ones the user picks so we do not allow dups.
$libs = get_logical_libraries($user, $sortCriteria);
$lib_count = count($libs);
$libNames = array();
foreach ($libs as $lib)
{
$libNames[] = $lib->name;
}
$counts = get_all_resource_counts($user);
$configuredCleaningSize = get_num_cleaning_slots($user);
$configuredMailboxSize = get_num_mailbox_slots($user);
//$maxMailboxSize = get_current_max_mailbox_size($user);
$mailboxSizes = get_allowed_mailbox_sizes($user);
$cleaningSizes = get_allowed_cleaning_sizes($user);
$defaultConfiguration = 0;
if ($counts->partition_count == 1 && $counts->media_count == 0
&& $counts->mailbox_count == 6 && $counts->unassigned_slot_count == 0
&& $counts->full_mailbox_count == 0)
{
$defaultConfiguration = 1;
$counts->partition_count = 0;
$counts->unassigned_drive_count = $counts->drive_count;
$counts->unassigned_slot_count = $counts->slot_count;
//$maxMailboxSize = $mailboxSizes[count($mailboxSizes) - 1];
}
$bNoPartitions = ($counts->partition_count==0 ? true: false);
$bNoPartitions = true; // CR 63964 This has changed a couple times - so I'm leaving the code in and just forcing the new behavior.
$mailboxIsEmpty = ($counts->full_mailbox_count==0 ? true: false);
error_log(".................................................................mailboxIsEmpty = " . ($mailboxIsEmpty ? "TRUE" : "FALSE"));
// Skip the auto partitioning if there are no resources
$nextDivFromMailboxPage = "partition";
$backDivFromConfirmPage = "partition";
if ($counts->unassigned_slot_count == 0 || $counts->unassigned_drive_count == 0)
{
$nextDivFromMailboxPage = "noresources";
$backDivFromConfirmPage = "mailboxQuest";
}
$features = get_licensed_features($user);
$date = get_date_and_time($user);
$useNTP = $date->ntp;
$timezones = get_timezones($user);
$hour = ltrim($date->hour,"0");
$minute = str_pad($date->minute,2,'0',STR_PAD_LEFT);
$dateString = strftime("%d-%b-%Y", $date->timestamp);
$currentTime = "$date->timezone:$dateString:$timeString";
// Get the avlible Drive types so we can chose the default number of partitions in Autocreate.
$drives = get_all_drives($user, $sortCriteria);
error_log("\n\n\nALL Drives = ". print_r($drives, true) );
$interfaceType = array(0,0,0,0,0,0); // "Unknown", "Fibre", "SCSI", "Serial", "Ethernet", "SAS"
foreach($drives as $drive)
{
if( $drive->name == "Physical Library" )
{
// It's an Avalible drive - log it's interface type
// Just set this to 1 so we can use it to add up the number of Different interface types.
// At this point we don't care how many of each there are.
$interfaceType[$drive->interfaceTypeEnum] = 1;
}
}
$AvalibleInterfaceType = $interfaceType[1] + $interfaceType[2] + $interfaceType[5]; // Only Fibre, SCSI and SAS for now
error_log(" There were ". $AvalibleInterfaceType ." avalible InterfaceTypes found.\n\n\n\n");
?>
Setup Partition
Setup Wizard
The Setup Wizard walks you through the process of configuring the following basic parameters for your library:
Installing a license
Setting the date and time
Partitioning the physical library
To reconfigure these parameters or to configure other parameters directly, use the option listed under the Setup Menu.
Setup Wizard - Licensing
Your library is currently licensed for the following features and slots:
Did you purchase any optional features or additional storage slots that require licensing?