diff --git a/system/pages/account/create.php b/system/pages/account/create.php index 0befa362..947ad0ad 100644 --- a/system/pages/account/create.php +++ b/system/pages/account/create.php @@ -221,8 +221,14 @@ if($save) } } - if(setting('core.account_premium_points') && setting('core.account_premium_points') > 0) { - $new_account->setCustomField('premium_points', setting('core.account_premium_points')); + $accountDefaultPremiumPoints = setting('core.account_premium_points'); + if($accountDefaultPremiumPoints > 0) { + $new_account->setCustomField('premium_points', $accountDefaultPremiumPoints); + } + + $accountDefaultCoins = setting('core.account_coins'); + if($db->hasColumn('accounts', 'coins') && $accountDefaultCoins > 0) { + $new_account->setCustomField('coins', $accountDefaultCoins); } $tmp_account = $email; diff --git a/system/settings.php b/system/settings.php index d0a705a0..c212587d 100644 --- a/system/settings.php +++ b/system/settings.php @@ -19,6 +19,8 @@ $templates = Cache::remember('templates', 5 * 60, function () { }); $defaultTemplate = in_array('kathrine', $templates) ? 'kathrine' : $templates[0]; +global $db; + return [ 'name' => 'MyAAC', 'settings' => [ @@ -674,6 +676,13 @@ Sent by MyAAC,
'desc' => 'Default premium points on new account', 'default' => 0, ], + 'account_coins' => [ + 'name' => 'Default Account Coins', + 'type' => 'number', + 'desc' => 'Default coins on new account', + 'hidden' => !$db->hasColumn('accounts', 'coins'), + 'default' => 0, + ], 'account_mail_change' => [ 'name' => 'Account Mail Change Days', 'type' => 'number',