25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

* src/web/ejabberd_web_admin.erl: max_user_sessions access rule

contains an integer, but webadmin always expects atoms (EJAB-482)

SVN Revision: 1124
This commit is contained in:
Badlop 2007-12-26 12:29:15 +00:00
parent 62b1811ed2
commit 892cec5651
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-12-26 Badlop <badlop@process-one.net>
* src/web/ejabberd_web_admin.erl: max_user_sessions access rule
contains an integer, but webadmin always expects atoms (EJAB-482)
2007-12-25 Badlop <badlop@process-one.net> 2007-12-25 Badlop <badlop@process-one.net>
* src/mod_configure.erl: Bugfix, update to match changes in * src/mod_configure.erl: Bugfix, update to match changes in

View File

@ -1223,7 +1223,7 @@ access_parse_delete(AccessRules, Host, Query) ->
access_rule_to_xhtml(Rules) -> access_rule_to_xhtml(Rules) ->
Text = lists:flatmap( Text = lists:flatmap(
fun({Access, ACL} = _Rule) -> fun({Access, ACL} = _Rule) ->
SAccess = atom_to_list(Access), SAccess = element_to_list(Access),
SACL = atom_to_list(ACL), SACL = atom_to_list(ACL),
SAccess ++ "\t" ++ SACL ++ "\n" SAccess ++ "\t" ++ SACL ++ "\n"
end, Rules), end, Rules),
@ -1238,7 +1238,7 @@ parse_access_rule(Text) ->
fun(String) -> fun(String) ->
case string:tokens(String, "\s\t") of case string:tokens(String, "\s\t") of
[Access, ACL] -> [Access, ACL] ->
[{list_to_atom(Access), list_to_atom(ACL)}]; [{list_to_element(Access), list_to_atom(ACL)}];
[] -> [] ->
[] []
end end
@ -2243,6 +2243,13 @@ pretty_print_xml({xmlelement, Name, Attrs, Els}, Prefix) ->
end end
end]. end].
element_to_list(X) when is_atom(X) -> atom_to_list(X);
element_to_list(X) when is_integer(X) -> integer_to_list(X).
list_to_element(List) ->
{ok, Tokens, _} = erl_scan:string(List),
[{_, _, Element}] = Tokens,
Element.
url_func({user_diapason, From, To}) -> url_func({user_diapason, From, To}) ->
integer_to_list(From) ++ "-" ++ integer_to_list(To) ++ "/"; integer_to_list(From) ++ "-" ++ integer_to_list(To) ++ "/";