mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
fix checking acl in mod_register_web
This commit is contained in:
parent
e9d104ec47
commit
71dba66330
@ -487,12 +487,13 @@ register_account(Username, Host, Password) ->
|
|||||||
Access = gen_mod:get_module_opt(Host, mod_register, access,
|
Access = gen_mod:get_module_opt(Host, mod_register, access,
|
||||||
fun(A) when is_atom(A) -> A end,
|
fun(A) when is_atom(A) -> A end,
|
||||||
all),
|
all),
|
||||||
JID = jlib:make_jid(Username, Host, <<"">>),
|
case jlib:make_jid(Username, Host, <<"">>) of
|
||||||
Match = acl:match_rule(Host, Access, JID),
|
error -> {error, invalid_jid};
|
||||||
case {JID, Match} of
|
JID ->
|
||||||
{error, _} -> {error, invalid_jid};
|
case acl:match_rule(Host, Access, JID) of
|
||||||
{_, deny} -> {error, not_allowed};
|
deny -> {error, not_allowed};
|
||||||
{_, allow} -> register_account2(Username, Host, Password)
|
allow -> register_account2(Username, Host, Password)
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
register_account2(Username, Host, Password) ->
|
register_account2(Username, Host, Password) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user