aboutsummaryrefslogtreecommitdiff
path: root/src/acl.erl
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2012-04-27 11:37:11 +0200
committerChristophe Romain <christophe.romain@process-one.net>2012-04-27 11:37:11 +0200
commit7f1e9d397285539fced4503f1385cf0ee3cf67d5 (patch)
tree53dae1a695e7b15c09bb50d64c31da4c77d4fcb2 /src/acl.erl
parentMake Safari happy use value from Host in WebSocket-Location header (diff)
parentUpdate ejabberd version number to 2.1.11 (diff)
merge from 2.1.11 and resolve conflicts
Diffstat (limited to 'src/acl.erl')
-rw-r--r--src/acl.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/acl.erl b/src/acl.erl
index 835577863..dd7c441de 100644
--- a/src/acl.erl
+++ b/src/acl.erl
@@ -181,9 +181,11 @@ match_acl(ACL, JID, Host) ->
lists:member(Server, ?MYHOSTS)))
andalso is_regexp_match(User, UR);
{shared_group, G} ->
- mod_shared_roster:is_user_in_group({User, Server}, G, Host);
+ Mod = loaded_shared_roster_module(Host),
+ Mod:is_user_in_group({User, Server}, G, Host);
{shared_group, G, H} ->
- mod_shared_roster:is_user_in_group({User, Server}, G, H);
+ Mod = loaded_shared_roster_module(H),
+ Mod:is_user_in_group({User, Server}, G, H);
{user_regexp, UR, S} ->
(S == Server) andalso
is_regexp_match(User, UR);
@@ -238,4 +240,10 @@ is_regexp_match(String, RegExp) ->
is_glob_match(String, Glob) ->
is_regexp_match(String, ejabberd_regexp:sh_to_awk(Glob)).
-
+loaded_shared_roster_module(Host) ->
+ case {gen_mod:is_loaded(Host, mod_shared_roster_odbc),
+ gen_mod:is_loaded(Host, mod_shared_roster_ldap)} of
+ {true, _} -> mod_shared_roster_odbc;
+ {_, true} -> mod_shared_roster_ldap;
+ _ -> mod_shared_roster
+ end.