25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

Allow mod_register_web to be accessed from now-served vhosts (#3173)

This commit is contained in:
Badlop 2020-02-26 13:27:22 +01:00
parent 00abf5d42c
commit 47c5aba1e5

View File

@ -93,31 +93,20 @@ process([], #request{method = 'GET', lang = Lang}) ->
process([<<"register.css">>],
#request{method = 'GET'}) ->
serve_css();
process([<<"new">>],
process([Section],
#request{method = 'GET', lang = Lang, host = Host,
ip = IP}) ->
case ejabberd_router:is_my_host(Host) of
ip = {Addr, _Port}}) ->
Host2 = case ejabberd_router:is_my_host(Host) of
true ->
{Addr, _Port} = IP,
form_new_get(Host, Lang, Addr);
Host;
false ->
{400, [], <<"Host not served">>}
end;
process([<<"delete">>],
#request{method = 'GET', lang = Lang, host = Host}) ->
case ejabberd_router:is_my_host(Host) of
true ->
form_del_get(Host, Lang);
false ->
{400, [], <<"Host not served">>}
end;
process([<<"change_password">>],
#request{method = 'GET', lang = Lang, host = Host}) ->
case ejabberd_router:is_my_host(Host) of
true ->
form_changepass_get(Host, Lang);
false ->
{400, [], <<"Host not served">>}
<<"">>
end,
case Section of
<<"new">> -> form_new_get(Host2, Lang, Addr);
<<"delete">> -> form_del_get(Host2, Lang);
<<"change_password">> -> form_changepass_get(Host2, Lang);
_ -> {404, [], "Not Found"}
end;
process([<<"new">>],
#request{method = 'POST', q = Q, ip = {Ip, _Port},