aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-11 19:13:36 +0200
committerKim Alvefur <zash@zash.se>2014-05-11 19:13:36 +0200
commitbacdff9a1532d2d2e4e0e9f811d4d584ea3a197c (patch)
tree7093bc4ed864d8c3a81a49f7b02e8c8ecc541728 /plugins/mod_admin_telnet.lua
parentf5da7bd8e02105fbaf717231c221c1bf82025211 (diff)
downloadprosody-bacdff9a1532d2d2e4e0e9f811d4d584ea3a197c.tar.gz
prosody-bacdff9a1532d2d2e4e0e9f811d4d584ea3a197c.zip
mod_admin_telnet: Add c2s:show_tls(), behaves like s2s:show_tls()
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r--plugins/mod_admin_telnet.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 4a9f74b6..a3352b10 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -220,6 +220,7 @@ function commands.help(session, data)
print [[c2s:show(jid) - Show all client sessions with the specified JID (or all if no JID given)]]
print [[c2s:show_insecure() - Show all unencrypted client connections]]
print [[c2s:show_secure() - Show all encrypted client connections]]
+ print [[c2s:show_tls() - Show TLS cipher info for encrypted sessions]]
print [[c2s:close(jid) - Close all sessions for the specified JID]]
elseif section == "s2s" then
print [[s2s:show(domain) - Show all s2s connections for the given domain (or all if no domain given)]]
@@ -567,8 +568,9 @@ function def_env.c2s:count(match_jid)
return true, "Total: "..count.." clients";
end
-function def_env.c2s:show(match_jid)
+function def_env.c2s:show(match_jid, annotate)
local print, count = self.session.print, 0;
+ annotate = annotate or session_flags;
local curr_host;
show_c2s(function (jid, session)
if curr_host ~= session.host then
@@ -577,7 +579,7 @@ function def_env.c2s:show(match_jid)
end
if (not match_jid) or jid:match(match_jid) then
count = count + 1;
- print(session_flags(session, { " ", jid }));
+ print(annotate(session, { " ", jid }));
end
end);
return true, "Total: "..count.." clients";
@@ -605,6 +607,10 @@ function def_env.c2s:show_secure(match_jid)
return true, "Total: "..count.." secure client connections";
end
+function def_env.c2s:show_tls(match_jid)
+ return self:show(match_jid, tls_info);
+end
+
function def_env.c2s:close(match_jid)
local count = 0;
show_c2s(function (jid, session)