[WIP] More work on settings

Move more config to settings (mainly mail_* + some other)
Remove mail_admin, wasnt used anywhere
Add return type to some functions
Add Twig settings(key) function
Possibility to save setting to db
This commit is contained in:
slawkens
2023-05-15 23:14:13 +02:00
parent 449fc2c1cf
commit 7929967ddc
29 changed files with 403 additions and 218 deletions

View File

@@ -219,7 +219,7 @@ if($save)
$tmp_account = (USE_ACCOUNT_NAME ? $account_name : $account_id);
}
if($config['mail_enabled'] && $config['account_mail_verify'])
if(setting('core.mail_enabled') && $config['account_mail_verify'])
{
$hash = md5(generateRandomString(16, true, true) . $email);
$new_account->setCustomField('email_hash', $hash);
@@ -294,7 +294,7 @@ if($save)
'custom_buttons' => config('account_create_character_create') ? '' : null
));
if($config['mail_enabled'] && $config['account_welcome_mail'])
if(setting('core.mail_enabled') && $config['account_welcome_mail'])
{
$mailBody = $twig->render('account.welcome_mail.html.twig', array(
'account' => $tmp_account
@@ -313,7 +313,7 @@ if($save)
}
$country_recognized = null;
if($config['account_country_recognize']) {
if(setting('core.account_country_recognize')) {
$country_session = getSession('country');
if($country_session !== false) { // get from session
$country_recognized = $country_session;