diff --git a/actions/admin/settings/131.ssl.php b/actions/admin/settings/131.ssl.php index 20a9f409..a77ec589 100644 --- a/actions/admin/settings/131.ssl.php +++ b/actions/admin/settings/131.ssl.php @@ -248,7 +248,7 @@ return [ 'settinggroup' => 'system', 'varname' => 'le_domain_dnscheck_resolver', 'type' => 'text', - 'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i', + 'string_type' => 'validate_ip', 'string_emptyallowed' => true, 'default' => '', 'save_method' => 'storeSettingField' diff --git a/install/froxlor.sql.php b/install/froxlor.sql.php index 2ed6b534..0b4d0218 100644 --- a/install/froxlor.sql.php +++ b/install/froxlor.sql.php @@ -686,7 +686,7 @@ opcache.validate_timestamps'), ('api', 'customer_default', '1'), ('2fa', 'enabled', '1'), ('panel', 'decimal_places', '4'), - ('panel', 'adminmail', 'admin@SERVERNAME'), + ('panel', 'adminmail', 'ADMIN_MAIL'), ('panel', 'phpmyadmin_url', ''), ('panel', 'webmail_url', ''), ('panel', 'webftp_url', ''), diff --git a/lib/Froxlor/Cli/ConfigServices.php b/lib/Froxlor/Cli/ConfigServices.php index 1833e0e2..2f280926 100644 --- a/lib/Froxlor/Cli/ConfigServices.php +++ b/lib/Froxlor/Cli/ConfigServices.php @@ -514,6 +514,7 @@ final class ConfigServices extends CliCommand '' => Settings::Get('system.httpgroup'), '' => Settings::Get('system.ssl_cert_file'), '' => Settings::Get('system.ssl_key_file'), + '' => Settings::Get('panel.adminmail'), ]; } } diff --git a/lib/Froxlor/Config/ConfigDisplay.php b/lib/Froxlor/Config/ConfigDisplay.php index cfaceb46..6cc76a65 100644 --- a/lib/Froxlor/Config/ConfigDisplay.php +++ b/lib/Froxlor/Config/ConfigDisplay.php @@ -117,7 +117,7 @@ class ConfigDisplay '' => 'FROXLOR_MYSQL_PASSWORD', '' => $sql['db'], '' => $sql['host'], - '' => isset($sql['socket']) ? $sql['socket'] : null, + '' => $sql['socket'] ?? null, '' => Settings::Get('system.hostname'), '' => Settings::Get('system.ipaddress'), '' => Settings::Get('system.nameservers'), @@ -127,12 +127,15 @@ class ConfigDisplay '' => Settings::Get('system.vmail_gid'), '' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '', '' => FileDir::makeCorrectDir($customer_tmpdir), - '' => FileDir::makeCorrectDir(Froxlor::getInstallDir()), + '' => Froxlor::getInstallDir(), '' => FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory')), '' => Settings::Get('system.apachereload_command'), '' => FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')), '' => FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')), - '' => Settings::Get('system.httpgroup') + '' => Settings::Get('system.httpgroup'), + '' => Settings::Get('system.ssl_cert_file'), + '' => Settings::Get('system.ssl_key_file'), + '' => Settings::Get('panel.adminmail'), ]; $commands_pre = ""; diff --git a/lib/Froxlor/Install/Install.php b/lib/Froxlor/Install/Install.php index 70bc443c..d0a4dcb6 100644 --- a/lib/Froxlor/Install/Install.php +++ b/lib/Froxlor/Install/Install.php @@ -99,7 +99,7 @@ class Install } // check for url manipulation or wrong step - if ((isset($_SESSION['installation']['stepCompleted']) && ($this->currentStep + 1) > $_SESSION['installation']['stepCompleted']) + if ((isset($_SESSION['installation']['stepCompleted']) && $this->currentStep > $_SESSION['installation']['stepCompleted']) || (!isset($_SESSION['installation']['stepCompleted']) && $this->currentStep > 0) ) { $this->currentStep = isset($_SESSION['installation']['stepCompleted']) ? $_SESSION['installation']['stepCompleted'] + 1 : 1; @@ -322,6 +322,8 @@ class Install $email = $validatedData['admin_email'] ?? ''; $password = $validatedData['admin_pass'] ?? ''; $password_confirm = $validatedData['admin_pass_confirm'] ?? ''; + $useadminmailassender = $validatedData['use_admin_email_as_sender'] ?? '1'; + $senderemail = $validatedData['sender_email'] ?? ''; if (!preg_match('/^[^\r\n\t\f\0]*$/D', $name)) { throw new Exception(lng('error.stringformaterror', ['admin_name'])); @@ -329,6 +331,8 @@ class Install throw new Exception(lng('error.loginnameiswrong', [$loginname])); } elseif (empty(trim($email)) || !Validate::validateEmail($email)) { throw new Exception(lng('error.emailiswrong', [$email])); + } elseif ((int)$useadminmailassender == 0 && !empty(trim($senderemail)) && !Validate::validateEmail($senderemail)) { + throw new Exception(lng('error.emailiswrong', [$senderemail])); } elseif (empty($password) || $password != $password_confirm) { throw new Exception(lng('error.newpasswordconfirmerror')); } elseif ($password == $loginname) { diff --git a/lib/Froxlor/Install/Install/Core.php b/lib/Froxlor/Install/Install/Core.php index ca21780e..ef66156e 100644 --- a/lib/Froxlor/Install/Install/Core.php +++ b/lib/Froxlor/Install/Install/Core.php @@ -365,7 +365,14 @@ class Core $mainip = !empty($this->validatedData['serveripv6']) ? $this->validatedData['serveripv6'] : $this->validatedData['serveripv4']; - $this->updateSetting($upd_stmt, 'admin@' . $this->validatedData['servername'], 'panel', 'adminmail'); + if ($this->validatedData['use_admin_email_as_sender'] == '1') { + $adminmail_value = $this->validatedData['admin_email']; + } elseif ($this->validatedData['use_admin_email_as_sender'] == '0' && !empty($this->validatedData['sender_email'])) { + $adminmail_value = $this->validatedData['sender_email']; + } else { + $adminmail_value = 'admin@' . $this->validatedData['servername']; + } + $this->updateSetting($upd_stmt, $adminmail_value, 'panel', 'adminmail'); $this->updateSetting($upd_stmt, $mainip, 'system', 'ipaddress'); if ($this->validatedData['use_ssl']) { $this->updateSetting($upd_stmt, 1, 'system', 'use_ssl'); @@ -563,7 +570,7 @@ class Core 'password' => password_hash($this->validatedData['admin_pass'], PASSWORD_DEFAULT), 'adminname' => $this->validatedData['admin_name'], 'email' => $this->validatedData['admin_email'], - 'deflang' => 'en' // TODO: set lanuage + 'deflang' => 'en' // TODO: set language ]; $ins_stmt = $db_user->prepare(" INSERT INTO `" . TABLE_PANEL_ADMINS . "` SET diff --git a/lib/configfiles/bookworm.xml b/lib/configfiles/bookworm.xml index 0eb13095..70b0cd3f 100644 --- a/lib/configfiles/bookworm.xml +++ b/lib/configfiles/bookworm.xml @@ -1556,7 +1556,7 @@ noc: root security: root # change this to a valid e-mail address you can access -root: root@ +root: ]]> diff --git a/lib/configfiles/bullseye.xml b/lib/configfiles/bullseye.xml index f44cc880..366689e0 100644 --- a/lib/configfiles/bullseye.xml +++ b/lib/configfiles/bullseye.xml @@ -1556,7 +1556,7 @@ noc: root security: root # change this to a valid e-mail address you can access -root: root@ +root: ]]> diff --git a/lib/configfiles/focal.xml b/lib/configfiles/focal.xml index deb305d9..67af7ed4 100644 --- a/lib/configfiles/focal.xml +++ b/lib/configfiles/focal.xml @@ -1585,7 +1585,7 @@ noc: root security: root # change this to a valid e-mail address you can access -root: root@ +root: ]]> diff --git a/lib/configfiles/gentoo.xml b/lib/configfiles/gentoo.xml index 9fb993e8..01d33fa9 100644 --- a/lib/configfiles/gentoo.xml +++ b/lib/configfiles/gentoo.xml @@ -1541,7 +1541,7 @@ noc: root security: root # change this to a valid e-mail address you can access -root: root@ +root: ]]> diff --git a/lib/configfiles/jammy.xml b/lib/configfiles/jammy.xml index 475958f9..67450c27 100644 --- a/lib/configfiles/jammy.xml +++ b/lib/configfiles/jammy.xml @@ -1585,7 +1585,7 @@ noc: root security: root # change this to a valid e-mail address you can access -root: root@ +root: ]]> diff --git a/lib/formfields/install/formfield.install.php b/lib/formfields/install/formfield.install.php index 2dbe0a1f..222832c8 100644 --- a/lib/formfields/install/formfield.install.php +++ b/lib/formfields/install/formfield.install.php @@ -143,6 +143,18 @@ return [ 'mandatory' => true, 'value' => old('admin_email', null, 'installation'), ], + 'use_admin_email_as_sender' => [ + 'label' => lng('install.admin.use_admin_email_as_sender'), + 'type' => 'checkbox', + 'value' => '1', + 'checked' => old('use_admin_email_as_sender', '1', 'installation'), + ], + 'sender_email' => [ + 'label' => lng('serversettings.adminmail.title'), + 'placeholder' => lng('install.admin.use_autogenerated_email_as_sender'), + 'type' => 'email', + 'value' => old('sender_email', null, 'installation'), + ], ] ], 'step3' => [ diff --git a/lng/de.lng.php b/lng/de.lng.php index 89991bb9..86f3438e 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -2253,6 +2253,8 @@ Vielen Dank, Ihr Administrator', 'top' => 'Admin Konto', 'title' => 'Erstellen des Haupt-Administrators.', 'description' => 'Dieser Benutzer erhält alle Berechtigungen zur Anpassungen von Einstellungen und Erstellen/Bearbeiten/Löschen von Resourcen wie Kunden, Domains, etc.', + 'use_admin_email_as_sender' => 'Verwende die oben angegebene E-Mail-Adresse als Absenderadresse. Wenn die Option deaktiviert ist, geben Sie unten bitte eine Absenderadresse an.', + 'use_autogenerated_email_as_sender' => 'Leer lassen für Standard: admin@servername', ], 'system' => [ 'top' => 'System Setup', diff --git a/lng/en.lng.php b/lng/en.lng.php index 2b3294f7..d511538a 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -2389,6 +2389,8 @@ Yours sincerely, your administrator', 'top' => 'Admin user', 'title' => 'Let\'s create the main administrator user.', 'description' => 'This user will be granted all privileges to adjust settings and add/update/delete resources like customers, domains, etc.', + 'use_admin_email_as_sender' => 'Use the email address above as sender address. If unchecked, please specify a sender address below.', + 'use_autogenerated_email_as_sender' => 'Leave empty for default: admin@servername', ], 'system' => [ 'top' => 'System setup', diff --git a/templates/Froxlor/assets/scss/components/_form.scss b/templates/Froxlor/assets/scss/components/_form.scss index bcaa6c60..4e3a7572 100644 --- a/templates/Froxlor/assets/scss/components/_form.scss +++ b/templates/Froxlor/assets/scss/components/_form.scss @@ -6,6 +6,14 @@ background-color: $body-tertiary-bg; } +.form-floating > .form-control::placeholder { + color: revert; +} + +.form-floating > .form-control:not(:focus)::placeholder { + color: transparent; +} + @include color-mode(dark) { .formfield { border-bottom: $border-color-dark solid 1px;