aboutsummaryrefslogtreecommitdiff
path: root/src/acl.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2012-04-04 20:37:43 +1000
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2012-04-04 20:37:43 +1000
commit41a0eae0bd1b70a15225c8ed95fa8c86115191c6 (patch)
treee44d4c98844f9ee4df4abd0d17189839801522bc /src/acl.erl
parentODBC support for mod_irc (diff)
ODBC support for mod_shared_roster
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.