From 9213ba76d8e112cc27071919db1f2d4c02b6c22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 4 Feb 2023 19:10:35 +0100 Subject: [PATCH 1/2] Update admin.lang --- htdocs/langs/en_US/admin.lang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8e0acd832d5..6ea2ef4fd10 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2366,3 +2366,6 @@ MaxNumberOfAttachementOnForms=Max number of joinded files in a form IfDefinedUseAValueBeetween=If defined, use a value between %s and %s Reload=Reload ConfirmReload=Confirm module reload +WarningModuleHasChangedLastVersionCheckParameter=Warning module %s has changed last version check parameter +WarningModuleHasChangedSecurityCsrfParameter=Warning module %s has changed security CSRF parameter + From 741fd1bf9cae362565d3f6f6084d7d2e059fb2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 4 Feb 2023 19:11:59 +0100 Subject: [PATCH 2/2] Update modules.php --- htdocs/admin/modules.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 6e0d90499d4..6adfe48ebfe 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-2023 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -251,7 +251,15 @@ if ($action == 'install') { } if ($action == 'set' && $user->admin) { + $checkOldValue = getDolGlobalInt('CHECKLASTVERSION_EXTERNALMODULE'); + $csrfCheckOldValue = getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN'); $resarray = activateModule($value); + if ($checkOldValue != getDolGlobalInt('CHECKLASTVERSION_EXTERNALMODULE')) { + setEventMessage($langs->trans('WarningModuleHasChangedLastVersionCheckParameter', $value), 'warnings'); + } + if ($csrfCheckOldValue != getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) { + setEventMessage($langs->trans('WarningModuleHasChangedSecurityCsrfParameter', $value), 'warnings'); + } dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if (!empty($resarray['errors'])) { setEventMessages('', $resarray['errors'], 'errors');