diff options
author | Kim Alvefur <zash@zash.se> | 2012-09-21 17:26:54 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-09-21 17:26:54 +0200 |
commit | 5399a5e5e67e5224376e34d0520f9d1f7d4958e0 (patch) | |
tree | b96d5c5677028d42cb7a982001d70c299bb9d2e1 | |
parent | 0c97ffd2a38b6cd459ff44c2f87f40b532fd3818 (diff) | |
download | prosody-5399a5e5e67e5224376e34d0520f9d1f7d4958e0.tar.gz prosody-5399a5e5e67e5224376e34d0520f9d1f7d4958e0.zip |
mod_admin_telnet: Add support for listing users
-rw-r--r-- | plugins/mod_admin_telnet.lua | 12 |
1 files changed, 12 insertions, 0 deletions
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"; |