25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Do not try to read/write the deprecated "config" table

This commit is contained in:
Evgeniy Khramtsov 2013-07-27 22:49:52 +10:00
parent 0b9754884e
commit f68dfacbbf
3 changed files with 17 additions and 17 deletions

View File

@ -724,8 +724,8 @@ process_admin(Host,
auth = {_, _Auth, AJID}, q = Query, lang = Lang}) ->
SetAccess = fun (Rs) ->
mnesia:transaction(fun () ->
Os = mnesia:select(config,
[{{config,
Os = mnesia:select(local_config,
[{{local_config,
{access,
'$1',
Host},
@ -739,7 +739,7 @@ process_admin(Host,
lists:foreach(fun ({access,
Name,
Rules}) ->
mnesia:write({config,
mnesia:write({local_config,
{access,
Name,
Host},
@ -764,8 +764,8 @@ process_admin(Host,
end;
_ -> nothing
end,
Access = ets:select(config,
[{{config, {access, '$1', Host}, '$2'}, [],
Access = ets:select(local_config,
[{{local_config, {access, '$1', Host}, '$2'}, [],
[{{access, '$1', '$2'}}]}]),
{NumLines, AccessP} = term_to_paragraph(lists:keysort(2,Access), 80),
make_xhtml((?H1GL((?T(<<"Access Rules">>)),
@ -798,8 +798,8 @@ process_admin(Host,
end;
_ -> nothing
end,
AccessRules = ets:select(config,
[{{config, {access, '$1', Host}, '$2'}, [],
AccessRules = ets:select(local_config,
[{{local_config, {access, '$1', Host}, '$2'}, [],
[{{access, '$1', '$2'}}]}]),
make_xhtml((?H1GL((?T(<<"Access Rules">>)),
<<"AccessRights">>, <<"Access Rights">>))
@ -1181,8 +1181,8 @@ access_rules_to_xhtml(AccessRules, Lang) ->
<<"Add New">>)])])]))]).
access_parse_query(Host, Query) ->
AccessRules = ets:select(config,
[{{config, {access, '$1', Host}, '$2'}, [],
AccessRules = ets:select(local_config,
[{{local_config, {access, '$1', Host}, '$2'}, [],
[{{access, '$1', '$2'}}]}]),
case lists:keysearch(<<"addnew">>, 1, Query) of
{value, _} ->
@ -1210,7 +1210,7 @@ access_parse_delete(AccessRules, Host, Query) ->
case lists:member({<<"selected">>, ID}, Query) of
true ->
mnesia:transaction(fun () ->
mnesia:delete({config,
mnesia:delete({local_config,
{access,
Name,
Host}})

View File

@ -1365,8 +1365,8 @@ get_form(Host, [<<"config">>, <<"access">>], Lang) ->
[{xmlcdata, S}]}
end,
str:tokens(iolist_to_binary(io_lib:format("~p.",
[ets:select(config,
[{{config,
[ets:select(local_config,
[{{local_config,
{access,
'$1',
'$2'},
@ -1770,8 +1770,8 @@ set_form(_From, Host, [<<"config">>, <<"access">>],
_Lang, XData) ->
SetAccess = fun (Rs) ->
mnesia:transaction(fun () ->
Os = mnesia:select(config,
[{{config,
Os = mnesia:select(local_config,
[{{local_config,
{access,
'$1',
'$2'},
@ -1787,7 +1787,7 @@ set_form(_From, Host, [<<"config">>, <<"access">>],
lists:foreach(fun ({access,
Name,
Rules}) ->
mnesia:write({config,
mnesia:write({local_config,
{access,
Name,
Host},

View File

@ -167,8 +167,8 @@ process_get(#xmlel{name = <<"acls">>, attrs = Attrs}) ->
process_get(#xmlel{name = <<"access">>,
attrs = Attrs}) ->
Str = iolist_to_binary(io_lib:format("~p.",
[ets:select(config,
[{{config, {access, '$1'},
[ets:select(local_config,
[{{local_config, {access, '$1'},
'$2'},
[],
[{{access, '$1',