diff --git a/src/acl.erl b/src/acl.erl index d3f9afe38..14439ce7a 100644 --- a/src/acl.erl +++ b/src/acl.erl @@ -449,9 +449,9 @@ access_matches(all, _Data, _Host) -> access_matches(none, _Data, _Host) -> deny; access_matches(Name, Data, Host) when is_atom(Name) -> - GAccess = ets:lookup(access, {Name, global}), + GAccess = mnesia:dirty_read(access, {Name, global}), LAccess = - if Host /= global -> ets:lookup(access, {Name, Host}); + if Host /= global -> mnesia:dirty_read(access, {Name, Host}); true -> [] end, case GAccess ++ LAccess of @@ -484,7 +484,7 @@ access_rules_matches([], _Data, _Host, Default) -> Default. get_aclspecs(ACL, Host) -> - ets:lookup(acl, {ACL, Host}) ++ ets:lookup(acl, {ACL, global}). + mnesia:dirty_read(acl, {ACL, Host}) ++ mnesia:dirty_read(acl, {ACL, global}). is_regexp_match(String, RegExp) -> case ejabberd_regexp:run(String, RegExp) of diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index 6583fb445..184f9775b 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -747,7 +747,7 @@ process_admin(Host, _ -> nothing end, ACLs = lists:keysort(2, - ets:select(acl, + mnesia:dirty_select(acl, [{{acl, {'$1', Host}, '$2'}, [], [{{acl, '$1', '$2'}}]}])), {NumLines, ACLsP} = term_to_paragraph(ACLs, 80), @@ -784,7 +784,7 @@ process_admin(Host, _ -> nothing end, ACLs = lists:keysort(2, - ets:select(acl, + mnesia:dirty_select(acl, [{{acl, {'$1', Host}, '$2'}, [], [{{acl, '$1', '$2'}}]}])), make_xhtml((?H1GL((?T(<<"Access Control Lists">>)), @@ -849,7 +849,7 @@ process_admin(Host, end; _ -> nothing end, - Access = ets:select(access, + Access = mnesia:dirty_select(access, [{{access, {'$1', Host}, '$2'}, [], [{{access, '$1', '$2'}}]}]), {NumLines, AccessP} = term_to_paragraph(lists:keysort(2,Access), 80), @@ -883,7 +883,7 @@ process_admin(Host, end; _ -> nothing end, - AccessRules = ets:select(access, + AccessRules = mnesia:dirty_select(access, [{{access, {'$1', Host}, '$2'}, [], [{{access, '$1', '$2'}}]}]), make_xhtml((?H1GL((?T(<<"Access Rules">>)), @@ -1153,7 +1153,7 @@ term_to_paragraph(T, Cols) -> term_to_id(T) -> jlib:encode_base64((term_to_binary(T))). acl_parse_query(Host, Query) -> - ACLs = ets:select(acl, + ACLs = mnesia:dirty_select(acl, [{{acl, {'$1', Host}, '$2'}, [], [{{acl, '$1', '$2'}}]}]), case lists:keysearch(<<"submit">>, 1, Query) of @@ -1267,7 +1267,7 @@ access_rules_to_xhtml(AccessRules, Lang) -> <<"Add New">>)])])]))]). access_parse_query(Host, Query) -> - AccessRules = ets:select(access, + AccessRules = mnesia:dirty_select(access, [{{access, {'$1', Host}, '$2'}, [], [{{access, '$1', '$2'}}]}]), case lists:keysearch(<<"addnew">>, 1, Query) of diff --git a/src/mod_configure.erl b/src/mod_configure.erl index d0e0166a4..03779d027 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -1337,7 +1337,7 @@ get_form(Host, [<<"config">>, <<"acls">>], Lang) -> [{xmlcdata, S}]} end, str:tokens(iolist_to_binary(io_lib:format("~p.", - [ets:select(acl, + [mnesia:dirty_select(acl, [{{acl, {'$1', '$2'}, @@ -1372,7 +1372,7 @@ get_form(Host, [<<"config">>, <<"access">>], Lang) -> [{xmlcdata, S}]} end, str:tokens(iolist_to_binary(io_lib:format("~p.", - [ets:select(access, + [mnesia:dirty_select(access, [{{access, {'$1', '$2'},