mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Merge pull request #156 from hamano/devel
mod_register_web: check same acl as mod_register.
This commit is contained in:
commit
2d441b3305
@ -485,9 +485,15 @@ form_del_get(Host, Lang) ->
|
|||||||
%% {error, not_allowed} |
|
%% {error, not_allowed} |
|
||||||
%% {error, invalid_jid}
|
%% {error, invalid_jid}
|
||||||
register_account(Username, Host, Password) ->
|
register_account(Username, Host, Password) ->
|
||||||
case jlib:make_jid(Username, Host, <<"">>) of
|
Access = gen_mod:get_module_opt(Host, mod_register, access,
|
||||||
error -> {error, invalid_jid};
|
fun(A) when is_atom(A) -> A end,
|
||||||
_ -> register_account2(Username, Host, Password)
|
all),
|
||||||
|
JID = jlib:make_jid(Username, Host, <<"">>),
|
||||||
|
Match = acl:match_rule(Host, Access, JID),
|
||||||
|
case {JID, Match} of
|
||||||
|
{error, _} -> {error, invalid_jid};
|
||||||
|
{_, deny} -> {error, not_allowed};
|
||||||
|
{_, allow} -> register_account2(Username, Host, Password)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
register_account2(Username, Host, Password) ->
|
register_account2(Username, Host, Password) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user