From cd2f211652f09e6991a609b2625ae4deec6b4110 Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:10:26 -0600 Subject: [PATCH 1/3] Error on function purgeSessions() at admin.lib.php Error on function purgeSessions() incorrect evaluation of dol_entity so never purge sessions --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 705cf304460c9..cf3b925b7715a 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1087,7 +1087,7 @@ function purgeSessions($mysessionid) $sessValues = file_get_contents($fullpath); // get raw session data if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session - preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity + (preg_match('/dol_entity\|i:('.$conf->entity.')/', $sessValues) || preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues)) && // limit to current entity preg_match('/dol_company\|s:([0-9]+):"(' . getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name $tmp = explode('_', $file); $idsess = $tmp[1]; From d711ec05d42c9a6f352c255c820844be7691168e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 7 Jan 2025 18:10:47 +0100 Subject: [PATCH 2/3] FIX broken feature, hook removed --- htdocs/accountancy/admin/account.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 2eea530e96e3a..df139d5d60df0 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -450,6 +450,10 @@ print '
'; + $parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From c130c292ed15e33e319122d643b12761b08e2f5e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jan 2025 19:07:40 +0100 Subject: [PATCH 3/3] fix: undefined variable and bad error messages --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 95b66d2551e60..58819af096f1b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2873,7 +2873,7 @@ $percent = $line->get_prev_progress($object->id); } if ((float) $all_progress < (float) $percent) { - $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent"); + $mesg = $langs->trans("Line").' '.$line->rang.' : '.$langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $result = -1; } else {