Merge pull request #23789 from glu000/16.0-issue-23787

Fix #23787 External user can see users from other companies in agenda view per user
This commit is contained in:
Laurent Destailleur 2023-02-06 00:05:16 +01:00 committed by GitHub
commit 60c750885f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -915,6 +915,10 @@ while ($currentdaytoshow < $lastdaytoshow) {
if ($usergroup > 0) {
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
}
if ($user->socid > 0) {
// External users should see only contacts of their company
$sql .= " AND u.fk_soc = ".((int) $user->socid);
}
//print $sql;
$resql = $db->query($sql);