From 3a2e70f79f8e4168ea57b854c9b1b259536898f0 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 19 Jun 2024 10:39:15 +0200 Subject: [PATCH] more info on preconfig regarding antispam feature and what will happen if not enabled; add comma to allowed characters in log-messages; make admin-username case-insensitive in the installation; show php-settings when adding/editing a domain as customer only if php is enbaled for the customer Signed-off-by: Michael Kaufmann --- install/updates/preconfig/preconfig_2.2.inc.php | 2 +- lib/Froxlor/FroxlorLogger.php | 2 +- lib/Froxlor/Install/Install.php | 2 +- lib/formfields/customer/domains/formfield.domains_add.php | 2 +- lib/formfields/customer/domains/formfield.domains_edit.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/updates/preconfig/preconfig_2.2.inc.php b/install/updates/preconfig/preconfig_2.2.inc.php index be735688..d063dff9 100644 --- a/install/updates/preconfig/preconfig_2.2.inc.php +++ b/install/updates/preconfig/preconfig_2.2.inc.php @@ -33,7 +33,7 @@ $return = []; if (Update::versionInUpdate($current_version, '2.2.0-dev1')) { $has_preconfig = true; - $description = 'Froxlor now features antispam configurations using rspamd. Would you like to enable the antispam feature (required re-configuration of services)?'; + $description = 'Froxlor now features antispam configurations using rspamd. Would you like to enable the antispam feature (required re-configuration of services)?
ATTENTION: When not enabled and the former DomainKey feature was used, keep in mind that all existing domainkeys for all domain are being removed and the dkim-flag disabled for the domains.'; $question = 'Enable antispam (recommended) '; $return['antispam_activated'] = [ 'type' => 'checkbox', diff --git a/lib/Froxlor/FroxlorLogger.php b/lib/Froxlor/FroxlorLogger.php index 6eeadf7f..5c37bb75 100644 --- a/lib/Froxlor/FroxlorLogger.php +++ b/lib/Froxlor/FroxlorLogger.php @@ -176,7 +176,7 @@ class FroxlorLogger } // clean log-text - $text = preg_replace("/[^\w @#\"':.()\[\]+\-_\/\\\!]/i", "_", $text); + $text = preg_replace("/[^\w @#\"':.,()\[\]+\-_\/\\\!]/i", "_", $text); if (self::$crondebug_flag || ($action == FroxlorLogger::CRON_ACTION && $type <= LOG_WARNING)) { echo "[" . $this->getLogLevelDesc($type) . "] " . $text . PHP_EOL; diff --git a/lib/Froxlor/Install/Install.php b/lib/Froxlor/Install/Install.php index d0a4dcb6..2a1fc1d9 100644 --- a/lib/Froxlor/Install/Install.php +++ b/lib/Froxlor/Install/Install.php @@ -327,7 +327,7 @@ class Install if (!preg_match('/^[^\r\n\t\f\0]*$/D', $name)) { throw new Exception(lng('error.stringformaterror', ['admin_name'])); - } elseif (empty(trim($loginname)) || !preg_match('/^[a-z][a-z0-9]+$/', $loginname)) { + } elseif (empty(trim($loginname)) || !preg_match('/^[a-z][a-z0-9]+$/Di', $loginname)) { throw new Exception(lng('error.loginnameiswrong', [$loginname])); } elseif (empty(trim($email)) || !Validate::validateEmail($email)) { throw new Exception(lng('error.emailiswrong', [$email])); diff --git a/lib/formfields/customer/domains/formfield.domains_add.php b/lib/formfields/customer/domains/formfield.domains_add.php index 610cf45a..fcd0c172 100644 --- a/lib/formfields/customer/domains/formfield.domains_add.php +++ b/lib/formfields/customer/domains/formfield.domains_add.php @@ -84,7 +84,7 @@ return [ 'select_var' => $openbasedir ], 'phpsettingid' => [ - 'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0, + 'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 && $userinfo['phpenabled'] == '1', 'label' => lng('admin.phpsettings.title'), 'type' => 'select', 'select_var' => $phpconfigs, diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index 10974832..bb2b25dc 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -99,7 +99,7 @@ return [ 'selected' => $result['openbasedir_path'] ], 'phpsettingid' => [ - 'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0, + 'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 && $userinfo['phpenabled'] == '1' && $result['phpenabled'] == '1', 'label' => lng('admin.phpsettings.title'), 'type' => 'select', 'select_var' => $phpconfigs,