From 1250ee5d77f22e927ffafb54c98fc45ed5d31026 Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Fri, 4 Apr 2014 04:07:29 +0900 Subject: [PATCH] mod_register_web: check same acl as mod_register. --- src/mod_register_web.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index cade4bcc8..cbb6cd082 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -485,9 +485,15 @@ form_del_get(Host, Lang) -> %% {error, not_allowed} | %% {error, invalid_jid} register_account(Username, Host, Password) -> - case jlib:make_jid(Username, Host, <<"">>) of - error -> {error, invalid_jid}; - _ -> register_account2(Username, Host, Password) + Access = gen_mod:get_module_opt(Host, mod_register, access, + fun(A) when is_atom(A) -> A end, + 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. register_account2(Username, Host, Password) ->