Make sure IQ result is correctly routed on account removal
Thanks to Philipp Hörist for spotting this
This commit is contained in:
parent
33a16090d3
commit
650bdae5d9
|
@ -131,12 +131,24 @@ process_iq(#iq{type = set, lang = Lang, to = To, from = From,
|
||||||
if is_binary(User) ->
|
if is_binary(User) ->
|
||||||
case From of
|
case From of
|
||||||
#jid{user = User, lserver = Server} ->
|
#jid{user = User, lserver = Server} ->
|
||||||
|
ResIQ = xmpp:make_iq_result(IQ),
|
||||||
|
ejabberd_router:route(ResIQ),
|
||||||
ejabberd_auth:remove_user(User, Server),
|
ejabberd_auth:remove_user(User, Server),
|
||||||
xmpp:make_iq_result(IQ);
|
ignore;
|
||||||
_ ->
|
_ ->
|
||||||
if is_binary(Password) ->
|
if is_binary(Password) ->
|
||||||
ejabberd_auth:remove_user(User, Server, Password),
|
case ejabberd_auth:check_password(
|
||||||
xmpp:make_iq_result(IQ);
|
User, <<"">>, Server, Password) of
|
||||||
|
true ->
|
||||||
|
ResIQ = xmpp:make_iq_result(IQ),
|
||||||
|
ejabberd_router:route(ResIQ),
|
||||||
|
ejabberd_auth:remove_user(User, Server),
|
||||||
|
ignore;
|
||||||
|
false ->
|
||||||
|
Txt = ?T("Incorrect password"),
|
||||||
|
xmpp:make_error(
|
||||||
|
IQ, xmpp:err_forbidden(Txt, Lang))
|
||||||
|
end;
|
||||||
true ->
|
true ->
|
||||||
Txt = ?T("No 'password' found in this query"),
|
Txt = ?T("No 'password' found in this query"),
|
||||||
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang))
|
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang))
|
||||||
|
|
Loading…
Reference in New Issue