# HG changeset patch # User Kim Alvefur # Date 1348241214 -7200 # Node ID c363e7e77f79f85e4bd3c7fae19c275e2e6c314e # Parent 0e1686f334b812bd3d2f7a537159d6d394155dd8 mod_admin_telnet: Add support for listing users diff -r 0e1686f334b8 -r c363e7e77f79 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Fri Sep 21 17:26:25 2012 +0200 +++ b/plugins/mod_admin_telnet.lua Fri Sep 21 17:26:54 2012 +0200 @@ -228,6 +228,7 @@ 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 @@ 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";