mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Gratis premium account (#156)
* skip premdays and lastdays calculation when premdays = 65535 (gratis premium in TFS)
* TFS consider 65535 as gratis premium account and PHP_INT_MAX does not assume this value
* adds condition of premdays=65535 and standardize the label "gratis premium account" with tibia client
* adjust the label "days" when there is only one day of premium account
* adjusted premium account status
* Some small adjustment
* Sorry, typo.
Co-authored-by: slawkens <slawkens@gmail.com>
(cherry picked from commit 9d7854dda6
)
This commit is contained in:
@@ -60,14 +60,15 @@ $errors = array();
|
||||
|
||||
if($action == '')
|
||||
{
|
||||
$freePremium = isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium']);
|
||||
$freePremium = isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium']) || $account_logged->getPremDays() == OTS_Account::GRATIS_PREMIUM_DAYS;
|
||||
$dayOrDays = $account_logged->getPremDays() == 1 ? 'day' : 'days';
|
||||
/**
|
||||
* @var OTS_Account $account_logged
|
||||
*/
|
||||
if(!$account_logged->isPremium())
|
||||
$account_status = '<b><span style="color: red">Free Account</span></b>';
|
||||
else
|
||||
$account_status = '<b><span style="color: green">Premium Account, ' . ($freePremium ? 'Unlimited' : $account_logged->getPremDays() . ' days left') . '</span></b>';
|
||||
$account_status = '<b><span style="color: green">' . ($freePremium ? 'Gratis Premium Account' : 'Premium Account, ' . $account_logged->getPremDays() . ' '.$dayOrDays.' left') . '</span></b>';
|
||||
|
||||
$recovery_key = $account_logged->getCustomField('key');
|
||||
if(empty($recovery_key))
|
||||
|
@@ -167,7 +167,7 @@ else if (isset($_REQUEST['search'])) {
|
||||
}
|
||||
|
||||
$lastDay = 0;
|
||||
if ($p_days != 0 && $p_days != PHP_INT_MAX) {
|
||||
if($p_days != 0 && $p_days != OTS_Account::GRATIS_PREMIUM_DAYS) {
|
||||
$lastDay = time();
|
||||
} else if ($lastDay != 0) {
|
||||
$lastDay = 0;
|
||||
|
Reference in New Issue
Block a user