]> granicus.if.org Git - ejabberd/commitdiff
Avoid logging IP addresses in mod_register when it's not desired
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 19 Mar 2018 15:23:52 +0000 (18:23 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 19 Mar 2018 15:23:52 +0000 (18:23 +0300)
Fixes #2326

src/mod_register.erl

index 38df8e225b89fc9065414db37ee021bbc98a15d2..98fcc944f0c52a39c0b7edf2cd21e7e8e09a37e0 100644 (file)
@@ -326,7 +326,8 @@ try_register(User, Server, Password, SourceRaw, Lang) ->
                                  ?INFO_MSG("The account ~s was registered "
                                            "from IP address ~s",
                                            [jid:encode({User, Server, <<"">>}),
-                                            ip_to_string(Source)]),
+                                            ejabberd_config:may_hide_data(
+                                              ip_to_string(Source))]),
                                  send_welcome_message(JID),
                                  send_registration_notifications(
                                     ?MODULE, JID, Source),
@@ -395,8 +396,9 @@ send_registration_notifications(Mod, UJID, Source) ->
                                                "IP address ~s on node ~w using ~p.",
                                                [get_time_string(),
                                                 jid:encode(UJID),
-                                                ip_to_string(Source), node(),
-                                                Mod])),
+                                               ejabberd_config:may_hide_data(
+                                                 ip_to_string(Source)),
+                                               node(), Mod])),
             lists:foreach(
               fun(JID) ->
                       ejabberd_router:route(