25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

is_user_in_group/3 must check if user belongs to given Group from Host specified on third argument.

* is_user_in_group/3 was checking if given user (passed on first parameter as
a bare jid) belonged to group of the server derived from this jid.
This commit is contained in:
Juan Pablo Carlino 2011-07-01 12:11:09 -03:00 committed by Pablo Polvorin
parent 15f664af26
commit 0cbd702419

View File

@ -602,10 +602,10 @@ get_user_displayed_groups(US) ->
end, get_user_groups(US))),
[Group || Group <- DisplayedGroups1, is_group_enabled(Host, Group)].
is_user_in_group({_U, S} = US, Group, Host) ->
is_user_in_group(US, Group, Host) ->
case catch mnesia:dirty_match_object(
#sr_user{us=US, group_host={Group, Host}}) of
[] -> lists:member(US, get_group_users(S, Group));
[] -> lists:member(US, get_group_users(Host, Group));
_ -> true
end.