2016-10-06 11:30:39 +01:00
|
|
|
<?php
|
|
|
|
function btw_license_error($code, $message)
|
|
|
|
{
|
2016-10-06 13:25:50 +01:00
|
|
|
// Remove an invalid license file - relevant to index.php as that's the main entry script
|
|
|
|
$licenseFile = sprintf('%s/blue-twilight.lic', dirname(__DIR__));
|
|
|
|
|
|
|
|
if (file_exists($licenseFile))
|
|
|
|
{
|
|
|
|
$number = 0;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
$backupFilename = sprintf('%s_invalid.%d', $licenseFile, $number++);
|
|
|
|
} while (file_exists($backupFilename));
|
|
|
|
|
|
|
|
// Rename or remove the file
|
|
|
|
if (!rename($licenseFile, $backupFilename))
|
|
|
|
{
|
|
|
|
@unlink($licenseFile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-06 11:30:39 +01:00
|
|
|
header(sprintf('Location: license-required.php?licerror=%d', $code));
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function btw_loader_error()
|
|
|
|
{
|
|
|
|
header('Location: loader-required.php');
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
?>
|