From 963fb40b2b04e3a3c14a68fddbaef68243fe1775 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 14 Apr 2025 11:13:15 +0300 Subject: [PATCH] fix save email settings --- install/core/actions/saveEmailSettings.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/install/core/actions/saveEmailSettings.php b/install/core/actions/saveEmailSettings.php index ec1ad29638..7062cc63d1 100644 --- a/install/core/actions/saveEmailSettings.php +++ b/install/core/actions/saveEmailSettings.php @@ -39,27 +39,26 @@ if (!empty($_SESSION['install'])) { ]; $preferences = []; + foreach ($paramList as $paramName) { - switch ($paramName) { - case 'smtpAuth': - $preferences['smtpAuth'] = (empty($_SESSION['install']['smtpAuth']) || $_SESSION['install']['smtpAuth'] == 'false' || !$_SESSION['install']['smtpAuth']) ? false : true; - break; - case 'outboundEmailIsShared': - $preferences['outboundEmailIsShared'] = (empty($_SESSION['install']['smtpAuth']) || $_SESSION['install']['outboundEmailIsShared'] == 'false' || !$_SESSION['install']['smtpAuth']) ? false : true; + $preferences['outboundEmailIsShared'] = $_SESSION['install']['outboundEmailIsShared'] === 'true'; + break; default: if (array_key_exists($paramName, $_SESSION['install'])) { $preferences[$paramName] = $_SESSION['install'][$paramName]; } + break; } } $res = $installer->savePreferences($preferences); + if (!empty($res)) { $result['success'] = true; } else {