mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-22 22:16:22 +01:00
Merge branch 'develop' into feature/2fa
This commit is contained in:
@@ -192,6 +192,21 @@ if($save)
|
||||
|
||||
$new_account->setPassword(encrypt($password));
|
||||
$new_account->setEMail($email);
|
||||
|
||||
$settingAccountPremiumDays = setting('core.account_premium_days');
|
||||
if($settingAccountPremiumDays && $settingAccountPremiumDays > 0) {
|
||||
$new_account->setPremDays($settingAccountPremiumDays);
|
||||
|
||||
if (!isCanary()) {
|
||||
$lastDay = 0;
|
||||
if($settingAccountPremiumDays != 0 && $settingAccountPremiumDays != OTS_Account::GRATIS_PREMIUM_DAYS) {
|
||||
$lastDay = time();
|
||||
}
|
||||
|
||||
$new_account->setLastLogin($lastDay);
|
||||
}
|
||||
}
|
||||
|
||||
$new_account->save();
|
||||
|
||||
$hooks->trigger(HOOK_ACCOUNT_CREATE_AFTER_SAVED, ['account' => $new_account]);
|
||||
@@ -206,22 +221,6 @@ if($save)
|
||||
$new_account->setCustomField('country', $country);
|
||||
}
|
||||
|
||||
$settingAccountPremiumDays = setting('core.account_premium_days');
|
||||
if($settingAccountPremiumDays && $settingAccountPremiumDays > 0) {
|
||||
if($db->hasColumn('accounts', 'premend')) { // othire
|
||||
$new_account->setCustomField('premend', time() + $settingAccountPremiumDays * 86400);
|
||||
}
|
||||
else { // rest
|
||||
if ($db->hasColumn('accounts', 'premium_ends_at')) { // TFS 1.4+
|
||||
$new_account->setCustomField('premium_ends_at', time() + $settingAccountPremiumDays * (60 * 60 * 24));
|
||||
}
|
||||
else {
|
||||
$new_account->setCustomField('premdays', $settingAccountPremiumDays);
|
||||
$new_account->setCustomField('lastday', time());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$accountDefaultPremiumPoints = setting('core.account_premium_points');
|
||||
if($accountDefaultPremiumPoints > 0) {
|
||||
$new_account->setCustomField('premium_points', $accountDefaultPremiumPoints);
|
||||
|
||||
Reference in New Issue
Block a user