]> granicus.if.org Git - ejabberd/commitdiff
* src/web/ejabberd_web_admin.erl: Show IP address of connected
authorAlexey Shchepin <alexey@process-one.net>
Sun, 10 Jun 2007 18:13:37 +0000 (18:13 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Sun, 10 Jun 2007 18:13:37 +0000 (18:13 +0000)
resources on user info page (thanks to Oleg Palij)

SVN Revision: 781

ChangeLog
src/web/ejabberd_web_admin.erl

index 456daaf47e32d26aa9e6375488d4eba78f563dc5..872c01c7c2959d4a972b83240c4417f70d2981aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-10  Alexey Shchepin  <alexey@sevcom.net>
+
+       * src/web/ejabberd_web_admin.erl: Show IP address of connected
+       resources on user info page (thanks to Oleg Palij)
+
 2007-06-07  Alexey Shchepin  <alexey@sevcom.net>
 
        * src/ejabberd_config.erl: Fixed "language" option processing
index cd054a62f7968d3e78bfe94802207aa34e3c4834..58b0ecb12efec00efb0e4ca4b528afe8d7df981f 100644 (file)
@@ -1493,7 +1493,18 @@ user_info(User, Server, Query, Lang) ->
            _ ->
                [?XE("ul",
                     lists:map(fun(R) ->
-                                      ?LI([?C(R)])
+                                      FIP = case ejabberd_sm:get_user_ip(
+                                                   User, Server, R) of
+                                                undefined ->
+                                                    "";
+                                                {IP, Port} ->
+                                                    " (" ++
+                                                        inet_parse:ntoa(IP) ++
+                                                        ":" ++
+                                                        integer_to_list(Port)
+                                                        ++ ")"
+                                            end,
+                                      ?LI([?C(R ++ FIP)])
                               end, lists:sort(Resources)))]
        end,
     Password = ejabberd_auth:get_password_s(User, Server),