From 352382bced470f9281b38472be683802e510597e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:02:16 +0200 Subject: [PATCH] FIX php8 compatibility --- htdocs/core/login/functions_dolibarr.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 610072aa35a..c4825998b3a 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -40,7 +40,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes // Force master entity in transversal mode $entity = $entitytotest; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $entity = 1; } @@ -134,11 +134,11 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes } // We must check entity - if ($passok && !empty($conf->multicompany->enabled)) { // We must check entity + if ($passok && isModEnabled('multicompany')) { // We must check entity global $mc; if (!isset($mc)) { - $conf->multicompany->enabled = false; // Global not available, disable $conf->multicompany->enabled for safety + !isModEnabled('multicompany'); // Global not available, disable $conf->multicompany->enabled for safety } else { $ret = $mc->checkRight($obj->rowid, $entitytotest); if ($ret < 0) {