possibility to specify sender address for froxlor as the admin-email address, custom or empty for system-default; fixes #1217
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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', ''),
|
||||
|
||||
@@ -514,6 +514,7 @@ final class ConfigServices extends CliCommand
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup'),
|
||||
'<SSL_CERT_FILE>' => Settings::Get('system.ssl_cert_file'),
|
||||
'<SSL_KEY_FILE>' => Settings::Get('system.ssl_key_file'),
|
||||
'<ADMIN_MAIL>' => Settings::Get('panel.adminmail'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ class ConfigDisplay
|
||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'FROXLOR_MYSQL_PASSWORD',
|
||||
'<SQL_DB>' => $sql['db'],
|
||||
'<SQL_HOST>' => $sql['host'],
|
||||
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
|
||||
'<SQL_SOCKET>' => $sql['socket'] ?? null,
|
||||
'<SERVERNAME>' => Settings::Get('system.hostname'),
|
||||
'<SERVERIP>' => Settings::Get('system.ipaddress'),
|
||||
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
|
||||
@@ -127,12 +127,15 @@ class ConfigDisplay
|
||||
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),
|
||||
'<SSLPROTOCOLS>' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '',
|
||||
'<CUSTOMER_TMP>' => FileDir::makeCorrectDir($customer_tmpdir),
|
||||
'<BASE_PATH>' => FileDir::makeCorrectDir(Froxlor::getInstallDir()),
|
||||
'<BASE_PATH>' => Froxlor::getInstallDir(),
|
||||
'<BIND_CONFIG_PATH>' => FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory')),
|
||||
'<WEBSERVER_RELOAD_CMD>' => Settings::Get('system.apachereload_command'),
|
||||
'<CUSTOMER_LOGS>' => FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')),
|
||||
'<FPM_IPCDIR>' => FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')),
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup')
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup'),
|
||||
'<SSL_CERT_FILE>' => Settings::Get('system.ssl_cert_file'),
|
||||
'<SSL_KEY_FILE>' => Settings::Get('system.ssl_key_file'),
|
||||
'<ADMIN_MAIL>' => Settings::Get('panel.adminmail'),
|
||||
];
|
||||
|
||||
$commands_pre = "";
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1556,7 +1556,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1556,7 +1556,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1585,7 +1585,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1541,7 +1541,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1585,7 +1585,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -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' => [
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user