From e269aa83b5a84e8bc18d95208eeaef5849530c7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Mar 2015 04:16:58 +0100 Subject: [PATCH] More comments --- htdocs/core/login/functions_dolibarr.php | 2 +- htdocs/core/login/functions_ldap.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 8e5a8b13ea9..0a0ab1e8bfe 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -101,7 +101,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= if ($passok && ! empty($obj->entity) && (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode))) { - $ret=$mc->checkRight($obj->rowid, $entitytotest); + $ret=$mc->checkRight($obj->rowid, $entitytotest); // The module multicompany check here user belong to at least one group into company. This is a bugged behaviour, so you must hack module to make thing working. if ($ret < 0) $passok=false; } diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 993249f3126..a67bc040e2f 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -169,10 +169,11 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) dol_syslog("functions_ldap::check_user_password_ldap Sync user found id=".$user->id); // On verifie si le login a change et on met a jour les attributs dolibarr - if ($conf->multicompany->enabled) { + if ($conf->multicompany->enabled) + { global $mc; - $ret=$mc->checkRight($user->id, $entitytotest); + $ret=$mc->checkRight($user->id, $entitytotest, $user); // The module multicompany check here user belong to at least one group into company. This is a bugged behaviour, so you must hack module to make thing working. if ($ret < 0) { dol_syslog("Failed to checkRight by module multicompany for user id = ".$user->id." into entity ".$entitytotest);