From 8e04a7ef4d6225c2ca4b2bdc59b50d0ff11e4217 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 3 Jul 2016 22:58:54 +0200 Subject: mod_configure: Fix editing of access rules --- src/mod_configure.erl | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mod_configure.erl b/src/mod_configure.erl index 515127684..9d4086559 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -1368,10 +1368,9 @@ get_form(Host, [<<"config">>, <<"access">>], Lang) -> [{xmlcdata, S}]} end, str:tokens(iolist_to_binary(io_lib:format("~p.", - [ets:select(local_config, - [{{local_config, - {access, - '$1', + [ets:select(access, + [{{access, + {'$1', '$2'}, '$3'}, [{'==', @@ -1826,10 +1825,9 @@ set_form(_From, Host, [<<"config">>, <<"access">>], Lang, XData) -> SetAccess = fun (Rs) -> mnesia:transaction(fun () -> - Os = mnesia:select(local_config, - [{{local_config, - {access, - '$1', + Os = mnesia:select(access, + [{{access, + {'$1', '$2'}, '$3'}, [{'==', @@ -1843,9 +1841,8 @@ set_form(_From, Host, [<<"config">>, <<"access">>], lists:foreach(fun ({access, Name, Rules}) -> - mnesia:write({local_config, - {access, - Name, + mnesia:write({access, + {Name, Host}, Rules}) end, -- cgit v1.2.3