refs #5: wrapped licensing errors functions in an if function_exists...
This commit is contained in:
parent
66e5c187be
commit
227de6baf6
@ -1,31 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
function btw_license_error($code, $message)
|
if (!function_exists('btw_license_error'))
|
||||||
{
|
{
|
||||||
// Remove an invalid license file - relevant to index.php as that's the main entry script
|
function btw_license_error($code, $message)
|
||||||
$licenseFile = sprintf('%s/blue-twilight.lic', dirname(__DIR__));
|
|
||||||
|
|
||||||
if (file_exists($licenseFile))
|
|
||||||
{
|
{
|
||||||
$number = 0;
|
// Remove an invalid license file - relevant to index.php as that's the main entry script
|
||||||
do
|
$licenseFile = sprintf('%s/blue-twilight.lic', dirname(__DIR__));
|
||||||
{
|
|
||||||
$backupFilename = sprintf('%s_invalid.%d', $licenseFile, $number++);
|
|
||||||
} while (file_exists($backupFilename));
|
|
||||||
|
|
||||||
// Rename or remove the file
|
if (file_exists($licenseFile))
|
||||||
if (!rename($licenseFile, $backupFilename))
|
|
||||||
{
|
{
|
||||||
@unlink($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));
|
header(sprintf('Location: license-required.php?licerror=%d', $code));
|
||||||
exit();
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function btw_loader_error()
|
if (!function_exists('btw_loader_error'))
|
||||||
{
|
{
|
||||||
header('Location: loader-required.php');
|
function btw_loader_error()
|
||||||
exit();
|
{
|
||||||
|
header('Location: loader-required.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user