From: Evgeniy Khramtsov Date: Tue, 14 Feb 2017 14:10:16 +0000 (+0300) Subject: Report password change in the log X-Git-Tag: 17.03-beta~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2b5153a8c5cfd233221e3b211465d8fb1fdc284;p=ejabberd Report password change in the log --- diff --git a/src/mod_register.erl b/src/mod_register.erl index 875640e9f..30b139bb2 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -268,11 +268,15 @@ try_register_or_set_password(User, Server, Password, end. %% @doc Try to change password and return IQ response -try_set_password(User, Server, Password, #iq{lang = Lang} = IQ) -> +try_set_password(User, Server, Password, #iq{lang = Lang, meta = M} = IQ) -> case is_strong_password(Server, Password) of true -> case ejabberd_auth:set_password(User, Server, Password) of ok -> + ?INFO_MSG("~s has changed password from ~s", + [jid:to_string({User, Server, <<"">>}), + ejabberd_config:may_hide_data( + jlib:ip_to_list(maps:get(ip, M, {0,0,0,0})))]), xmpp:make_iq_result(IQ); {error, empty_password} -> Txt = <<"Empty password">>,