aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-09-21 17:26:54 +0200
committerKim Alvefur <zash@zash.se>2012-09-21 17:26:54 +0200
commit9dcdb35e5ffb139edb17e049c72715f3eab76c42 (patch)
treeb96d5c5677028d42cb7a982001d70c299bb9d2e1
parentab915e9dd4c9083cb77650a5a498d1a04fbeccb5 (diff)
downloadprosody-9dcdb35e5ffb139edb17e049c72715f3eab76c42.tar.gz
prosody-9dcdb35e5ffb139edb17e049c72715f3eab76c42.zip
mod_admin_telnet: Add support for listing users
-rw-r--r--plugins/mod_admin_telnet.lua12
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";