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 | e0cfa023d9435a295bc26f04ed529a523da38ae4 (patch) | |
tree | 738afab3ead87d4977bfae57a46e9f2250360f59 | |
parent | 857a961dfe312b400e0a11762130c3327dd55948 (diff) | |
download | prosody-e0cfa023d9435a295bc26f04ed529a523da38ae4.tar.gz prosody-e0cfa023d9435a295bc26f04ed529a523da38ae4.zip |
mod_admin_telnet: Show unauthenticated clients identified by local/remote IP and port
-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) |