From 0a52abab5df8cca431a71f9f4cecf1f5bd06ad90 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Apr 2016 13:38:32 +0200 Subject: [PATCH] Fix: broken multicompany transverse mode authentication feature --- htdocs/user/class/user.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 85f340b1cb1..1ee07e0a7af 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -207,7 +207,10 @@ class User extends CommonObject } else // The fetch was forced on an entity { - $sql.= " WHERE u.entity IN (0, ".$conf->entity.")"; + if (!empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode)) + $sql.= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database + else + $sql.= " WHERE u.entity IN (0, ".$conf->entity.")"; } if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba