Skip to content

Commit

Permalink
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 11, 2024
2 parents ce4dc61 + ab760df commit 2df1ea2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htdocs/user/class/user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,11 @@ public function RemoveFromGroup($group, $entity, $notrigger = 0)
$sql = "DELETE FROM ".$this->db->prefix()."usergroup_user";
$sql .= " WHERE fk_user = ".((int) $this->id);
$sql .= " AND fk_usergroup = ".((int) $group);
$sql .= " AND entity = ".((int) $entity);
if (empty($entity)) {
$sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1.
} else {
$sql .= " AND entity = ".((int) $entity);
}

$result = $this->db->query($sql);
if ($result) {
Expand Down

0 comments on commit 2df1ea2

Please sign in to comment.