From 48874f5b07ed8ebbe5c517a251842417090a99a8 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 7 Oct 2020 23:22:02 +0200 Subject: [PATCH] Disable mail_enabled by default on clean install Causes too many issues when no smpt server available and other options are not configured --- install/index.php | 4 ---- install/steps/5-database.php | 6 ------ system/locale/de/install.php | 3 --- system/locale/en/install.php | 3 --- system/locale/pl/install.php | 5 +---- system/locale/pt_br/install.php | 3 --- system/locale/sv/install.php | 5 +---- system/templates/install.config.html.twig | 2 +- 8 files changed, 3 insertions(+), 28 deletions(-) diff --git a/install/index.php b/install/index.php index 255d89e2..1bc0e4ba 100644 --- a/install/index.php +++ b/install/index.php @@ -95,10 +95,6 @@ if($step == 'database') { $errors[] = $locale['step_config_mail_admin_error']; break; } - else if($key == 'mail_address' && !Validator::email($value)) { - $errors[] = $locale['step_config_mail_address_error']; - break; - } else if($key == 'timezone' && !in_array($value, DateTimeZone::listIdentifiers())) { $errors[] = $locale['step_config_timezone_error']; break; diff --git a/install/steps/5-database.php b/install/steps/5-database.php index a86bcb4b..1b5a6be7 100644 --- a/install/steps/5-database.php +++ b/install/steps/5-database.php @@ -21,8 +21,6 @@ if(!$error) { // user can disable when he wants $content .= '$config[\'env\'] = \'prod\'; // dev or prod'; $content .= PHP_EOL; - $content .= '$config[\'mail_enabled\'] = true;'; - $content .= PHP_EOL; foreach($_SESSION as $key => $value) { if(strpos($key, 'var_') !== false) @@ -67,10 +65,6 @@ if(!$error) { error($locale['step_config_mail_admin_error']); $error = true; } - if(!Validator::email($_SESSION['var_mail_address'])) { - error($locale['step_config_mail_address_error']); - $error = true; - } $content .= '$config[\'session_prefix\'] = \'myaac_' . generateRandomString(8, true, false, true, false) . '_\';'; $content .= PHP_EOL; diff --git a/system/locale/de/install.php b/system/locale/de/install.php index 9307d22b..0ed461f6 100644 --- a/system/locale/de/install.php +++ b/system/locale/de/install.php @@ -47,9 +47,6 @@ $locale['step_config_server_path_desc'] = 'Pfad zu Ihrem TFS-Hauptverzeichnis, i $locale['step_config_mail_admin'] = 'Admin E-Mail'; $locale['step_config_mail_admin_desc'] = 'Adresse, an die E-Mails aus dem Kontaktformular gesendet werden, z. B. admin@gmail.com'; $locale['step_config_mail_admin_error'] = 'Admin E-Mail ist nicht korrekt.'; -$locale['step_config_mail_address'] = 'Server E-Mail'; -$locale['step_config_mail_address_desc'] = 'Adresse, die für ausgehende E-Mails (von :) verwendet wird, zB no-reply@your-server.org'; -$locale['step_config_mail_address_error'] = 'Server E-Mail ist nicht korrekt.'; $locale['step_config_timezone'] = 'Zeitzone'; $locale['step_config_timezone_desc'] = 'Wird für Datumsfunktionen verwendet'; $locale['step_config_timezone_error'] = 'Zeitzone ist nicht korrekt.'; diff --git a/system/locale/en/install.php b/system/locale/en/install.php index 7bf7ad76..a0a1f9bf 100644 --- a/system/locale/en/install.php +++ b/system/locale/en/install.php @@ -47,9 +47,6 @@ $locale['step_config_server_path_desc'] = 'Path to your TFS main directory, wher $locale['step_config_mail_admin'] = 'Admin Email'; $locale['step_config_mail_admin_desc'] = 'Address where emails from contact form will be delivered, for example admin@gmail.com'; $locale['step_config_mail_admin_error'] = 'Admin Email is not correct.'; -$locale['step_config_mail_address'] = 'Server Email'; -$locale['step_config_mail_address_desc'] = 'Address which will be used for outgoing emails (from:), for example no-reply@your-server.org'; -$locale['step_config_mail_address_error'] = 'Server Email is not correct.'; $locale['step_config_timezone'] = 'Timezone'; $locale['step_config_timezone_desc'] = 'Used for date functions'; $locale['step_config_timezone_error'] = 'Timezone is not correct.'; diff --git a/system/locale/pl/install.php b/system/locale/pl/install.php index f12af021..ec81548b 100644 --- a/system/locale/pl/install.php +++ b/system/locale/pl/install.php @@ -45,11 +45,8 @@ $locale['step_config_title'] = 'Podstawowa konfiguracja'; $locale['step_config_server_path'] = 'Ścieżka do serwera'; $locale['step_config_server_path_desc'] = 'Ścieżka do Twojego folderu z TFS, gdzie znajduje się plik config.lua.'; $locale['step_config_mail_admin'] = 'E-Mail admina'; -$locale['step_config_mail_admin_desc'] = 'Na ten adres będą dostarczane E-Maile z formularza kontaktowego , przykładowo admin@gmail.com'; +$locale['step_config_mail_admin_desc'] = 'Na ten adres będą dostarczane E-Maile z formularza kontaktowego, przykładowo admin@gmail.com'; $locale['step_config_mail_admin_error'] = 'E-Mail admina jest niepoprawny.'; -$locale['step_config_mail_address'] = 'E-Mail serwera'; -$locale['step_config_mail_address_desc'] = 'Ten adres będzie używany do wysyłanych wiadomości z serwera (from:), przykładowo no-reply@twój-serwer.org'; -$locale['step_config_mail_address_error'] = 'E-Mail serwera jest niepoprawny.'; $locale['step_config_client'] = 'Wersja klienta'; $locale['step_config_client_desc'] = 'Używana do strony pobieranie klienta oraz kilku szablonów'; $locale['step_config_usage'] = 'Raportowanie Statystyk'; diff --git a/system/locale/pt_br/install.php b/system/locale/pt_br/install.php index 0c239e7e..029fd322 100644 --- a/system/locale/pt_br/install.php +++ b/system/locale/pt_br/install.php @@ -47,9 +47,6 @@ $locale['step_config_server_path_desc'] = 'Caminho para seu diretório principal $locale['step_config_mail_admin'] = 'E-mail de administrador'; $locale['step_config_mail_admin_desc'] = 'Endereço em que os emails do formulário de contato serão entregues, por exemplo admin@gmail.com'; $locale['step_config_mail_admin_error'] = 'E-mail de administrador não está correto.'; -$locale['step_config_mail_address'] = 'E-mail do servidor'; -$locale['step_config_mail_address_desc'] = 'Endereço que será usado para emails de saída (de :), por exemplo no-reply@your-server.org'; -$locale['step_config_mail_address_error'] = 'E-mail do servidor não está correto.'; $locale['step_config_timezone'] = 'Fuso horário'; $locale['step_config_timezone_desc'] = 'Usado para funções de data.'; $locale['step_config_timezone_error'] = 'O fuso horário não está correto.'; diff --git a/system/locale/sv/install.php b/system/locale/sv/install.php index 81c4f608..328ce91a 100644 --- a/system/locale/sv/install.php +++ b/system/locale/sv/install.php @@ -42,14 +42,11 @@ $locale['step_config'] = 'Konfiguration'; $locale['step_config_title'] = 'Grundläggande konfiguration'; $locale['step_config_server_path'] = 'Server mapp'; $locale['step_config_server_path_desc'] = 'Mappen som innhåller exe filen till The Forgotten Server, där du har din config.lua.'; + $locale['step_config_mail_admin'] = 'Admin E-Post'; $locale['step_config_mail_admin_desc'] = 'Adress där E-Post från kontaktförmolär kommer att leveraras, till exempel admin@gmail.com'; - $locale['step_config_mail_admin_error'] = 'Admin E-Post är inte korrekt.'; -$locale['step_config_mail_address'] = 'Server E-Post'; -$locale['step_config_mail_address_desc'] = 'Adress som kommer att användas för utgående email (från:), till exempel no-reply@your-server.org'; -$locale['step_config_mail_address_error'] = 'Server E-Post är inte korrekt.'; $locale['step_config_client'] = 'Klientversion'; $locale['step_config_client_desc'] = 'Används för nerladdningssidan och teman.'; diff --git a/system/templates/install.config.html.twig b/system/templates/install.config.html.twig index 6f881bf1..64765910 100644 --- a/system/templates/install.config.html.twig +++ b/system/templates/install.config.html.twig @@ -1,7 +1,7 @@
- {% for value in ['server_path', 'mail_admin', 'mail_address'] %} + {% for value in ['server_path', 'mail_admin'] %}