From 8156fbfea3f27dad2df548f63771f3d84c2dbc8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Thu, 4 Apr 2024 11:44:22 +0200 Subject: [PATCH 1/4] FIX: Ticket new message notification sent twice --- htdocs/ticket/class/ticket.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 72bba5e2b1a..bc18e34ffe8 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2572,10 +2572,9 @@ class Ticket extends CommonObject continue; } - if ($info_sendto['email'] != '') { - if (!empty($info_sendto['email'])) { - $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">"; - } + // We check if the email address is not the assignee's address to prevent notification from being sent twice + if (!empty($info_sendto['email']) && $assigned_user->email != $info_sendto['email']) { + $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">"; } } From 285080fc74b001b9b08d382aa422ab1a9f408b3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2024 16:06:21 +0200 Subject: [PATCH 2/4] Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 --- htdocs/admin/modules.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 19a34b5ad4f..ad8fa3b545a 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -121,6 +121,13 @@ if ($max_time && $max_time < $max_execution_time_for_deploy) { @ini_set("max_execution_time", $max_execution_time_for_deploy); // This work only if safe mode is off. also web servers has timeout of 300 } +$dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); +$allowonlineinstall = true; +$allowfromweb = 1; +if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) { + $allowonlineinstall = false; +} + /* * Actions @@ -141,7 +148,7 @@ if (GETPOST('buttonreset', 'alpha')) { $search_version = ''; } -if ($action == 'install') { +if ($action == 'install' && $allowonlineinstall) { $error = 0; // $original_file should match format module_modulename-x.y[.z].zip @@ -262,6 +269,8 @@ if ($action == 'install') { if (!$error) { setEventMessages($langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")), null, 'warnings'); } +} elseif ($action == 'install' && !$allowonlineinstall) { + httponly_accessforbidden("You try to bypass the protection to disallow deployment of an external module. Hack attempt ?"); } if ($action == 'set' && $user->admin) { @@ -1175,13 +1184,6 @@ if ($mode == 'deploy') { print $deschelp; - $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); - $allowonlineinstall = true; - $allowfromweb = 1; - if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) { - $allowonlineinstall = false; - } - $fullurl = ''.$urldolibarrmodules.''; $message = ''; if ($allowonlineinstall) { From 9e638ccc12c46a9f4aeb213216353c53a976f1cd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Apr 2024 16:22:31 +0200 Subject: [PATCH 3/4] FIX avoid to delete "lock" and "unlock" files --- htdocs/core/class/utils.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9907ae29834..83049fe334a 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -96,14 +96,14 @@ class Utils if ($choice == 'allfiles') { // Delete all files (except install.lock, do not follow symbolic links) if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', '[\.lock|\.unlock]$', 'name', SORT_ASC, 0, 0, '', 1); } } if ($choice == 'logfile' || $choice == 'logfiles') { // Define files log if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', '[\.lock|\.unlock]$', 'name', SORT_ASC, 0, 0, '', 1); } if (!empty($conf->syslog->enabled)) { From cb9a93d97eca6507e59b1bb97900e537265cb67a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Apr 2024 16:32:24 +0200 Subject: [PATCH 4/4] FIX syntax error (but same result) :-) --- htdocs/core/class/utils.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 83049fe334a..c8599612340 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -96,14 +96,14 @@ class Utils if ($choice == 'allfiles') { // Delete all files (except install.lock, do not follow symbolic links) if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', '[\.lock|\.unlock]$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1); } } if ($choice == 'logfile' || $choice == 'logfiles') { // Define files log if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', '[\.lock|\.unlock]$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1); } if (!empty($conf->syslog->enabled)) {