From ba70794c1df50e9a31d836dc77b1c50919316467 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Mon, 16 Dec 2013 09:45:38 +0100 Subject: [PATCH] Add multicompany->enabled test --- htdocs/core/login/functions_ldap.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index ca9fcfd3a02..07c568d41fc 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -41,7 +41,6 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) global $dolibarr_main_auth_ldap_admin_login,$dolibarr_main_auth_ldap_admin_pass; global $dolibarr_main_auth_ldap_filter; global $dolibarr_main_auth_ldap_debug; - global $mc; if (! function_exists("ldap_connect")) { @@ -169,8 +168,14 @@ 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 - $ret=$mc->checkRight($user->id, $entitytotest); - if ($ret < 0) $login=false; // provoque l'echec de l'identification + + if ($conf->multicompany->enabled) { + global $mc; + + $ret=$mc->checkRight($user->id, $entitytotest); + if ($ret < 0) $login=false; // provoque l'echec de l'identification + } + if ($user->login != $ldap->login && $ldap->login) {