blue-twilight/public/raw/sg-license-error.php

37 lines
962 B
PHP

<?php
if (!function_exists('btw_license_error'))
{
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 invalid file
if (!rename($licenseFile, $backupFilename))
{
@unlink($licenseFile);
}
}
header(sprintf('Location: license-required.php?licerror=%d', $code));
exit();
}
}
if (!function_exists('btw_loader_error'))
{
function btw_loader_error()
{
header('Location: loader-required.php');
exit();
}
}
?>