diff options
author | Kim Alvefur <zash@zash.se> | 2016-01-09 23:59:31 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-01-09 23:59:31 +0100 |
commit | 1e0c45235c480931de7c51ae5f8b0e205e977306 (patch) | |
tree | 738afab3ead87d4977bfae57a46e9f2250360f59 /plugins | |
parent | 4ad60283f8f36dcf5ec29c7bd97cd089df46a5d6 (diff) | |
download | prosody-1e0c45235c480931de7c51ae5f8b0e205e977306.tar.gz prosody-1e0c45235c480931de7c51ae5f8b0e205e977306.zip |
mod_admin_telnet: Show unauthenticated clients identified by local/remote IP and port
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 8 |
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) |