Do not try to read/write the deprecated "config" table
This commit is contained in:
parent
0b9754884e
commit
f68dfacbbf
|
@ -724,8 +724,8 @@ process_admin(Host,
|
||||||
auth = {_, _Auth, AJID}, q = Query, lang = Lang}) ->
|
auth = {_, _Auth, AJID}, q = Query, lang = Lang}) ->
|
||||||
SetAccess = fun (Rs) ->
|
SetAccess = fun (Rs) ->
|
||||||
mnesia:transaction(fun () ->
|
mnesia:transaction(fun () ->
|
||||||
Os = mnesia:select(config,
|
Os = mnesia:select(local_config,
|
||||||
[{{config,
|
[{{local_config,
|
||||||
{access,
|
{access,
|
||||||
'$1',
|
'$1',
|
||||||
Host},
|
Host},
|
||||||
|
@ -739,7 +739,7 @@ process_admin(Host,
|
||||||
lists:foreach(fun ({access,
|
lists:foreach(fun ({access,
|
||||||
Name,
|
Name,
|
||||||
Rules}) ->
|
Rules}) ->
|
||||||
mnesia:write({config,
|
mnesia:write({local_config,
|
||||||
{access,
|
{access,
|
||||||
Name,
|
Name,
|
||||||
Host},
|
Host},
|
||||||
|
@ -764,8 +764,8 @@ process_admin(Host,
|
||||||
end;
|
end;
|
||||||
_ -> nothing
|
_ -> nothing
|
||||||
end,
|
end,
|
||||||
Access = ets:select(config,
|
Access = ets:select(local_config,
|
||||||
[{{config, {access, '$1', Host}, '$2'}, [],
|
[{{local_config, {access, '$1', Host}, '$2'}, [],
|
||||||
[{{access, '$1', '$2'}}]}]),
|
[{{access, '$1', '$2'}}]}]),
|
||||||
{NumLines, AccessP} = term_to_paragraph(lists:keysort(2,Access), 80),
|
{NumLines, AccessP} = term_to_paragraph(lists:keysort(2,Access), 80),
|
||||||
make_xhtml((?H1GL((?T(<<"Access Rules">>)),
|
make_xhtml((?H1GL((?T(<<"Access Rules">>)),
|
||||||
|
@ -798,8 +798,8 @@ process_admin(Host,
|
||||||
end;
|
end;
|
||||||
_ -> nothing
|
_ -> nothing
|
||||||
end,
|
end,
|
||||||
AccessRules = ets:select(config,
|
AccessRules = ets:select(local_config,
|
||||||
[{{config, {access, '$1', Host}, '$2'}, [],
|
[{{local_config, {access, '$1', Host}, '$2'}, [],
|
||||||
[{{access, '$1', '$2'}}]}]),
|
[{{access, '$1', '$2'}}]}]),
|
||||||
make_xhtml((?H1GL((?T(<<"Access Rules">>)),
|
make_xhtml((?H1GL((?T(<<"Access Rules">>)),
|
||||||
<<"AccessRights">>, <<"Access Rights">>))
|
<<"AccessRights">>, <<"Access Rights">>))
|
||||||
|
@ -1181,8 +1181,8 @@ access_rules_to_xhtml(AccessRules, Lang) ->
|
||||||
<<"Add New">>)])])]))]).
|
<<"Add New">>)])])]))]).
|
||||||
|
|
||||||
access_parse_query(Host, Query) ->
|
access_parse_query(Host, Query) ->
|
||||||
AccessRules = ets:select(config,
|
AccessRules = ets:select(local_config,
|
||||||
[{{config, {access, '$1', Host}, '$2'}, [],
|
[{{local_config, {access, '$1', Host}, '$2'}, [],
|
||||||
[{{access, '$1', '$2'}}]}]),
|
[{{access, '$1', '$2'}}]}]),
|
||||||
case lists:keysearch(<<"addnew">>, 1, Query) of
|
case lists:keysearch(<<"addnew">>, 1, Query) of
|
||||||
{value, _} ->
|
{value, _} ->
|
||||||
|
@ -1210,7 +1210,7 @@ access_parse_delete(AccessRules, Host, Query) ->
|
||||||
case lists:member({<<"selected">>, ID}, Query) of
|
case lists:member({<<"selected">>, ID}, Query) of
|
||||||
true ->
|
true ->
|
||||||
mnesia:transaction(fun () ->
|
mnesia:transaction(fun () ->
|
||||||
mnesia:delete({config,
|
mnesia:delete({local_config,
|
||||||
{access,
|
{access,
|
||||||
Name,
|
Name,
|
||||||
Host}})
|
Host}})
|
||||||
|
|
|
@ -1365,8 +1365,8 @@ get_form(Host, [<<"config">>, <<"access">>], Lang) ->
|
||||||
[{xmlcdata, S}]}
|
[{xmlcdata, S}]}
|
||||||
end,
|
end,
|
||||||
str:tokens(iolist_to_binary(io_lib:format("~p.",
|
str:tokens(iolist_to_binary(io_lib:format("~p.",
|
||||||
[ets:select(config,
|
[ets:select(local_config,
|
||||||
[{{config,
|
[{{local_config,
|
||||||
{access,
|
{access,
|
||||||
'$1',
|
'$1',
|
||||||
'$2'},
|
'$2'},
|
||||||
|
@ -1770,8 +1770,8 @@ set_form(_From, Host, [<<"config">>, <<"access">>],
|
||||||
_Lang, XData) ->
|
_Lang, XData) ->
|
||||||
SetAccess = fun (Rs) ->
|
SetAccess = fun (Rs) ->
|
||||||
mnesia:transaction(fun () ->
|
mnesia:transaction(fun () ->
|
||||||
Os = mnesia:select(config,
|
Os = mnesia:select(local_config,
|
||||||
[{{config,
|
[{{local_config,
|
||||||
{access,
|
{access,
|
||||||
'$1',
|
'$1',
|
||||||
'$2'},
|
'$2'},
|
||||||
|
@ -1787,7 +1787,7 @@ set_form(_From, Host, [<<"config">>, <<"access">>],
|
||||||
lists:foreach(fun ({access,
|
lists:foreach(fun ({access,
|
||||||
Name,
|
Name,
|
||||||
Rules}) ->
|
Rules}) ->
|
||||||
mnesia:write({config,
|
mnesia:write({local_config,
|
||||||
{access,
|
{access,
|
||||||
Name,
|
Name,
|
||||||
Host},
|
Host},
|
||||||
|
|
|
@ -167,8 +167,8 @@ process_get(#xmlel{name = <<"acls">>, attrs = Attrs}) ->
|
||||||
process_get(#xmlel{name = <<"access">>,
|
process_get(#xmlel{name = <<"access">>,
|
||||||
attrs = Attrs}) ->
|
attrs = Attrs}) ->
|
||||||
Str = iolist_to_binary(io_lib:format("~p.",
|
Str = iolist_to_binary(io_lib:format("~p.",
|
||||||
[ets:select(config,
|
[ets:select(local_config,
|
||||||
[{{config, {access, '$1'},
|
[{{local_config, {access, '$1'},
|
||||||
'$2'},
|
'$2'},
|
||||||
[],
|
[],
|
||||||
[{{access, '$1',
|
[{{access, '$1',
|
||||||
|
|
Loading…
Reference in New Issue