From 9dcdb35e5ffb139edb17e049c72715f3eab76c42 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Sep 2012 17:26:54 +0200 Subject: mod_admin_telnet: Add support for listing users --- plugins/mod_admin_telnet.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 62fb10a0..3fb56c58 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -228,6 +228,7 @@ function commands.help(session, data) print [[user:create(jid, password) - Create the specified user account]] print [[user:password(jid, password) - Set the password for the specified user account]] print [[user:delete(jid) - Permanently remove the specified user account]] + print [[host:list(hostname) - List users on the specified host]] elseif section == "server" then print [[server:version() - Show the server's version number]] print [[server:uptime() - Show how long the server has been running]] @@ -952,6 +953,17 @@ function def_env.user:password(jid, password) end end +function def_env.user:list(host) + if not host then + return nil, "No host given"; + end + local print = self.session.print; + for user in um.users(host) do + print(user.."@"..host); + end + return true; +end + def_env.xmpp = {}; local st = require "util.stanza"; -- cgit v1.2.3