31 lines
761 B
PHP
31 lines
761 B
PHP
<?php
|
|
function btw_license_error($code, $message)
|
|
{
|
|
// 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);
|
|
}
|
|
}
|
|
|
|
header(sprintf('Location: license-required.php?licerror=%d', $code));
|
|
exit();
|
|
}
|
|
|
|
function btw_loader_error()
|
|
{
|
|
header('Location: loader-required.php');
|
|
exit();
|
|
}
|
|
?>
|