aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-09 23:59:31 +0100
committerKim Alvefur <zash@zash.se>2016-01-09 23:59:31 +0100
commit1e0c45235c480931de7c51ae5f8b0e205e977306 (patch)
tree738afab3ead87d4977bfae57a46e9f2250360f59
parent4ad60283f8f36dcf5ec29c7bd97cd089df46a5d6 (diff)
downloadprosody-1e0c45235c480931de7c51ae5f8b0e205e977306.tar.gz
prosody-1e0c45235c480931de7c51ae5f8b0e205e977306.zip
mod_admin_telnet: Show unauthenticated clients identified by local/remote IP and port
-rw-r--r--plugins/mod_admin_telnet.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index c3434d33..b45db3ef 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -543,7 +543,13 @@ local function get_jid(session)
if session.username then
return session.full_jid or jid_join(session.username, session.host, session.resource);
end
- return "(unknown)";
+
+ local conn = session.conn;
+ local ip = session.ip or "?";
+ local clientport = conn and conn:clientport() or "?";
+ local serverip = conn and conn.server and conn:server():ip() or "?";
+ local serverport = conn and conn:serverport() or "?"
+ return jid_join("["..ip.."]:"..clientport, session.host or "["..serverip.."]:"..serverport);
end
local function show_c2s(callback)