24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-14 22:00:16 +02:00

Log a message when a user gets registered

This commit is contained in:
Evgeniy Khramtsov 2017-11-17 18:02:12 +03:00
parent 4f12359b9c
commit 3202b7a9a1

View File

@ -334,6 +334,10 @@ try_register(User, Server, Password, SourceRaw, Lang) ->
Password) Password)
of of
ok -> ok ->
?INFO_MSG("The account ~s was registered "
"from IP address ~s",
[jid:encode({User, Server, <<"">>}),
ip_to_string(Source)]),
send_welcome_message(JID), send_welcome_message(JID),
send_registration_notifications( send_registration_notifications(
?MODULE, JID, Source), ?MODULE, JID, Source),
@ -492,6 +496,8 @@ remove_timeout(Source) ->
true -> ok true -> ok
end. end.
ip_to_string({_, _, _} = USR) ->
jid:encode(USR);
ip_to_string(Source) when is_tuple(Source) -> ip_to_string(Source) when is_tuple(Source) ->
misc:ip_to_list(Source); misc:ip_to_list(Source);
ip_to_string(undefined) -> <<"undefined">>; ip_to_string(undefined) -> <<"undefined">>;