From c437aecb1fc7bb66492ccdefb1feb875c67a51cc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 5 Sep 2023 10:06:30 +0200 Subject: [PATCH] FIX multicompany compatibility --- htdocs/master.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 50a03e6fdb3..70c35008c8d 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -191,9 +191,9 @@ if (session_id() && !empty($_SESSION["dol_entity"])) { } elseif (!empty($_ENV["dol_entity"])) { // Entity inside a CLI script $conf->entity = $_ENV["dol_entity"]; -} elseif (GETPOSTISSET("loginfunction") && GETPOST("entity", 'int')) { +} elseif (GETPOSTISSET("loginfunction") && (GETPOST("entity", 'int') || GETPOST("switchentity", 'int'))) { // Just after a login page - $conf->entity = GETPOST("entity", 'int'); + $conf->entity = (GETPOSTISSET("entity") ? GETPOST("entity", 'int') : GETPOST("switchentity", 'int')); } elseif (defined('DOLENTITY') && is_numeric(constant('DOLENTITY'))) { // For public page with MultiCompany module $conf->entity = constant('DOLENTITY');