1 -- Copyright (C) 2009-2011 Florian Zeitz
3 -- This file is MIT/X11 licensed. Please see the
4 -- COPYING file in the source package for more information.
9 local prosody = _G.prosody;
10 local hosts = prosody.hosts;
11 local t_concat = table.concat;
13 local iterators = require "util.iterators";
14 local keys, values = iterators.keys, iterators.values;
15 local usermanager_user_exists = require "core.usermanager".user_exists;
16 local usermanager_create_user = require "core.usermanager".create_user;
17 local usermanager_delete_user = require "core.usermanager".delete_user;
18 local usermanager_get_password = require "core.usermanager".get_password;
19 local usermanager_set_password = require "core.usermanager".set_password;
20 local hostmanager_activate = require "core.hostmanager".activate;
21 local hostmanager_deactivate = require "core.hostmanager".deactivate;
22 local is_admin = require "core.usermanager".is_admin;
23 local rm_load_roster = require "core.rostermanager".load_roster;
24 local st, jid, uuid = require "util.stanza", require "util.jid", require "util.uuid";
25 local timer_add_task = require "util.timer".add_task;
26 local dataforms_new = require "util.dataforms".new;
27 local array = require "util.array";
28 local modulemanager = require "modulemanager";
29 local core_post_stanza = prosody.core_post_stanza;
31 module:depends("adhoc");
32 local adhoc_new = module:require "adhoc".new;
34 local function generate_error_message(errors)
36 for name, err in pairs(errors) do
37 errmsg[#errmsg + 1] = name .. ": " .. err;
39 return { status = "completed", error = { message = t_concat(errmsg, "\n") } };
42 function add_user_command_handler(self, data, state)
43 local add_user_layout = dataforms_new{
44 title = "Adding a User";
45 instructions = "Fill out this form to add a user.";
47 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
48 { name = "accountjid", type = "jid-single", required = true, label = "The Jabber ID for the account to be added" };
49 { name = "password", type = "text-private", label = "The password for this account" };
50 { name = "password-verify", type = "text-private", label = "Retype password" };
54 if data.action == "cancel" then
55 return { status = "canceled" };
57 local fields, err = add_user_layout:data(data.form);
59 return generate_error_message(err);
61 local username, host, resource = jid.split(fields.accountjid);
62 if data.to ~= host then
63 return { status = "completed", error = { message = "Trying to add a user on " .. host .. " but command was sent to " .. data.to}};
65 if (fields["password"] == fields["password-verify"]) and username and host then
66 if usermanager_user_exists(username, host) then
67 return { status = "completed", error = { message = "Account already exists" } };
69 if usermanager_create_user(username, fields.password, host) then
70 module:log("info", "Created new account %s@%s", username, host);
71 return { status = "completed", info = "Account successfully created" };
73 return { status = "completed", error = { message = "Failed to write data to disk" } };
77 module:log("debug", "Invalid data, password mismatch or empty username while creating account for %s", fields.accountjid or "<nil>");
78 return { status = "completed", error = { message = "Invalid data.\nPassword mismatch, or empty username" } };
81 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = add_user_layout }, "executing";
85 function change_user_password_command_handler(self, data, state)
86 local change_user_password_layout = dataforms_new{
87 title = "Changing a User Password";
88 instructions = "Fill out this form to change a user's password.";
90 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
91 { name = "accountjid", type = "jid-single", required = true, label = "The Jabber ID for this account" };
92 { name = "password", type = "text-private", required = true, label = "The password for this account" };
96 if data.action == "cancel" then
97 return { status = "canceled" };
99 local fields, err = change_user_password_layout:data(data.form);
101 return generate_error_message(err);
103 local username, host, resource = jid.split(fields.accountjid);
104 if data.to ~= host then
105 return { status = "completed", error = { message = "Trying to change the password of a user on " .. host .. " but command was sent to " .. data.to}};
107 if usermanager_user_exists(username, host) and usermanager_set_password(username, fields.password, host) then
108 return { status = "completed", info = "Password successfully changed" };
110 return { status = "completed", error = { message = "User does not exist" } };
113 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = change_user_password_layout }, "executing";
117 function config_reload_handler(self, data, state)
118 local ok, err = prosody.reload_config();
120 return { status = "completed", info = "Configuration reloaded (modules may need to be reloaded for this to have an effect)" };
122 return { status = "completed", error = { message = "Failed to reload config: " .. tostring(err) } };
127 function delete_user_command_handler(self, data, state)
128 local delete_user_layout = dataforms_new{
129 title = "Deleting a User";
130 instructions = "Fill out this form to delete a user.";
132 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
133 { name = "accountjids", type = "jid-multi", label = "The Jabber ID(s) to delete" };
137 if data.action == "cancel" then
138 return { status = "canceled" };
140 local fields, err = delete_user_layout:data(data.form);
142 return generate_error_message(err);
145 local succeeded = {};
146 for _, aJID in ipairs(fields.accountjids) do
147 local username, host, resource = jid.split(aJID);
148 if (host == data.to) and usermanager_user_exists(username, host) and usermanager_delete_user(username, host) then
149 module:log("debug", "User %s has been deleted", aJID);
150 succeeded[#succeeded+1] = aJID;
152 module:log("debug", "Tried to delete non-existant user %s", aJID);
153 failed[#failed+1] = aJID;
156 return {status = "completed", info = (#succeeded ~= 0 and
157 "The following accounts were successfully deleted:\n"..t_concat(succeeded, "\n").."\n" or "")..
159 "The following accounts could not be deleted:\n"..t_concat(failed, "\n") or "") };
161 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = delete_user_layout }, "executing";
165 function disconnect_user(match_jid)
166 local node, hostname, givenResource = jid.split(match_jid);
167 local host = hosts[hostname];
168 local sessions = host.sessions[node] and host.sessions[node].sessions;
169 for resource, session in pairs(sessions or {}) do
170 if not givenResource or (resource == givenResource) then
171 module:log("debug", "Disconnecting %s@%s/%s", node, hostname, resource);
178 function end_user_session_handler(self, data, state)
179 local end_user_session_layout = dataforms_new{
180 title = "Ending a User Session";
181 instructions = "Fill out this form to end a user's session.";
183 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
184 { name = "accountjids", type = "jid-multi", label = "The Jabber ID(s) for which to end sessions" };
188 if data.action == "cancel" then
189 return { status = "canceled" };
192 local fields, err = end_user_session_layout:data(data.form);
194 return generate_error_message(err);
197 local succeeded = {};
198 for _, aJID in ipairs(fields.accountjids) do
199 local username, host, resource = jid.split(aJID);
200 if (host == data.to) and usermanager_user_exists(username, host) and disconnect_user(aJID) then
201 succeeded[#succeeded+1] = aJID;
203 failed[#failed+1] = aJID;
206 return {status = "completed", info = (#succeeded ~= 0 and
207 "The following accounts were successfully disconnected:\n"..t_concat(succeeded, "\n").."\n" or "")..
209 "The following accounts could not be disconnected:\n"..t_concat(failed, "\n") or "") };
211 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = end_user_session_layout }, "executing";
215 local end_user_session_layout = dataforms_new{
216 title = "Ending a User Session";
217 instructions = "Fill out this form to end a user's session.";
219 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
220 { name = "accountjids", type = "jid-multi", label = "The Jabber ID(s) for which to end sessions" };
224 function get_user_password_handler(self, data, state)
225 local get_user_password_layout = dataforms_new{
226 title = "Getting User's Password";
227 instructions = "Fill out this form to get a user's password.";
229 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
230 { name = "accountjid", type = "jid-single", required = true, label = "The Jabber ID for which to retrieve the password" };
233 local get_user_password_result_layout = dataforms_new{
234 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
235 { name = "accountjid", type = "jid-single", label = "JID" };
236 { name = "password", type = "text-single", label = "Password" };
240 if data.action == "cancel" then
241 return { status = "canceled" };
243 local fields, err = get_user_password_layout:data(data.form);
245 return generate_error_message(err);
247 local user, host, resource = jid.split(fields.accountjid);
248 local accountjid = "";
250 if host ~= data.to then
251 return { status = "completed", error = { message = "Tried to get password for a user on " .. host .. " but command was sent to " .. data.to } };
252 elseif usermanager_user_exists(user, host) then
253 accountjid = fields.accountjid;
254 password = usermanager_get_password(user, host);
256 return { status = "completed", error = { message = "User does not exist" } };
258 return { status = "completed", result = { layout = get_user_password_result_layout, values = {accountjid = accountjid, password = password} } };
260 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_user_password_layout }, "executing";
264 function get_user_roster_handler(self, data, state)
265 local get_user_roster_layout = dataforms_new{
266 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
267 { name = "accountjid", type = "jid-single", required = true, label = "The Jabber ID for which to retrieve the roster" };
270 local get_user_roster_result_layout = dataforms_new{
271 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
272 { name = "accountjid", type = "jid-single", label = "This is the roster for" };
273 { name = "roster", type = "text-multi", label = "Roster XML" };
277 if data.action == "cancel" then
278 return { status = "canceled" };
281 local fields, err = get_user_roster_layout:data(data.form);
284 return generate_error_message(err);
287 local user, host, resource = jid.split(fields.accountjid);
288 if host ~= data.to then
289 return { status = "completed", error = { message = "Tried to get roster for a user on " .. host .. " but command was sent to " .. data.to } };
290 elseif not usermanager_user_exists(user, host) then
291 return { status = "completed", error = { message = "User does not exist" } };
293 local roster = rm_load_roster(user, host);
295 local query = st.stanza("query", { xmlns = "jabber:iq:roster" });
296 for jid in pairs(roster) do
297 if jid ~= "pending" and jid then
300 subscription = roster[jid].subscription,
301 ask = roster[jid].ask,
302 name = roster[jid].name,
304 for group in pairs(roster[jid].groups) do
305 query:tag("group"):text(group):up();
311 local query_text = query:__tostring(); -- TODO: Use upcoming pretty_print() function
312 query_text = query_text:gsub("><", ">\n<");
314 local result = get_user_roster_result_layout:form({ accountjid = user.."@"..host, roster = query_text }, "result");
315 result:add_child(query);
316 return { status = "completed", other = result };
318 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_user_roster_layout }, "executing";
322 function get_user_stats_handler(self, data, state)
323 local get_user_stats_layout = dataforms_new{
324 title = "Get User Statistics";
325 instructions = "Fill out this form to gather user statistics.";
327 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
328 { name = "accountjid", type = "jid-single", required = true, label = "The Jabber ID for statistics" };
331 local get_user_stats_result_layout = dataforms_new{
332 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
333 { name = "ipaddresses", type = "text-multi", label = "IP Addresses" };
334 { name = "rostersize", type = "text-single", label = "Roster size" };
335 { name = "onlineresources", type = "text-multi", label = "Online Resources" };
339 if data.action == "cancel" then
340 return { status = "canceled" };
343 local fields, err = get_user_stats_layout:data(data.form);
346 return generate_error_message(err);
349 local user, host, resource = jid.split(fields.accountjid);
350 if host ~= data.to then
351 return { status = "completed", error = { message = "Tried to get stats for a user on " .. host .. " but command was sent to " .. data.to } };
352 elseif not usermanager_user_exists(user, host) then
353 return { status = "completed", error = { message = "User does not exist" } };
355 local roster = rm_load_roster(user, host);
356 local rostersize = 0;
358 local resources = "";
359 for jid in pairs(roster) do
360 if jid ~= "pending" and jid then
361 rostersize = rostersize + 1;
364 for resource, session in pairs((hosts[host].sessions[user] and hosts[host].sessions[user].sessions) or {}) do
365 resources = resources .. "\n" .. resource;
366 IPs = IPs .. "\n" .. session.ip;
368 return { status = "completed", result = {layout = get_user_stats_result_layout, values = {ipaddresses = IPs, rostersize = tostring(rostersize),
369 onlineresources = resources}} };
371 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_user_stats_layout }, "executing";
375 function get_online_users_command_handler(self, data, state)
376 local get_online_users_layout = dataforms_new{
377 title = "Getting List of Online Users";
378 instructions = "How many users should be returned at most?";
380 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
381 { name = "max_items", type = "list-single", label = "Maximum number of users",
382 value = { "25", "50", "75", "100", "150", "200", "all" } };
383 { name = "details", type = "boolean", label = "Show details" };
386 local get_online_users_result_layout = dataforms_new{
387 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
388 { name = "onlineuserjids", type = "text-multi", label = "The list of all online users" };
392 if data.action == "cancel" then
393 return { status = "canceled" };
396 local fields, err = get_online_users_layout:data(data.form);
399 return generate_error_message(err);
402 local max_items = nil
403 if fields.max_items ~= "all" then
404 max_items = tonumber(fields.max_items);
408 for username, user in pairs(hosts[data.to].sessions or {}) do
409 if (max_items ~= nil) and (count >= max_items) then
412 users[#users+1] = username.."@"..data.to;
414 if fields.details then
415 for resource, session in pairs(user.sessions or {}) do
416 local status, priority = "unavailable", tostring(session.priority or "-");
417 if session.presence then
418 status = session.presence:child_with_name("show");
420 status = status:get_text() or "[invalid!]";
422 status = "available";
425 users[#users+1] = " - "..resource..": "..status.."("..priority..")";
429 return { status = "completed", result = {layout = get_online_users_result_layout, values = {onlineuserjids=t_concat(users, "\n")}} };
431 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_online_users_layout }, "executing";
435 function list_modules_handler(self, data, state)
436 local result = dataforms_new {
437 title = "List of loaded modules";
439 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/modules#list" };
440 { name = "modules", type = "text-multi", label = "The following modules are loaded:" };
443 local modules = array.collect(keys(hosts[data.to].modules)):sort():concat("\n");
445 return { status = "completed", result = { layout = result; values = { modules = modules } } };
448 function load_module_handler(self, data, state)
449 local layout = dataforms_new {
450 title = "Load module";
451 instructions = "Specify the module to be loaded";
453 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/modules#load" };
454 { name = "module", type = "text-single", required = true, label = "Module to be loaded:"};
457 if data.action == "cancel" then
458 return { status = "canceled" };
460 local fields, err = layout:data(data.form);
462 return generate_error_message(err);
464 if modulemanager.is_loaded(data.to, fields.module) then
465 return { status = "completed", info = "Module already loaded" };
467 local ok, err = modulemanager.load(data.to, fields.module);
469 return { status = "completed", info = 'Module "'..fields.module..'" successfully loaded on host "'..data.to..'".' };
471 return { status = "completed", error = { message = 'Failed to load module "'..fields.module..'" on host "'..data.to..
472 '". Error was: "'..tostring(err or "<unspecified>")..'"' } };
475 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = layout }, "executing";
479 function reload_modules_handler(self, data, state)
480 local layout = dataforms_new {
481 title = "Reload modules";
482 instructions = "Select the modules to be reloaded";
484 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/modules#reload" };
485 { name = "modules", type = "list-multi", required = true, label = "Modules to be reloaded:"};
488 if data.action == "cancel" then
489 return { status = "canceled" };
491 local fields, err = layout:data(data.form);
493 return generate_error_message(err);
495 local ok_list, err_list = {}, {};
496 for _, module in ipairs(fields.modules) do
497 local ok, err = modulemanager.reload(data.to, module);
499 ok_list[#ok_list + 1] = module;
501 err_list[#err_list + 1] = module .. "(Error: " .. tostring(err) .. ")";
504 local info = (#ok_list > 0 and ("The following modules were successfully reloaded on host "..data.to..":\n"..t_concat(ok_list, "\n")) or "")..
505 (#err_list > 0 and ("Failed to reload the following modules on host "..data.to..":\n"..t_concat(err_list, "\n")) or "");
506 return { status = "completed", info = info };
508 local modules = array.collect(keys(hosts[data.to].modules)):sort();
509 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing";
513 function send_to_online(message, server)
515 sessions = { [server] = hosts[server] };
521 for domain, session in pairs(sessions) do
522 for user in pairs(session.sessions or {}) do
524 message.attr.from = domain;
525 message.attr.to = user.."@"..domain;
526 core_post_stanza(session, message);
533 function shut_down_service_handler(self, data, state)
534 local shut_down_service_layout = dataforms_new{
535 title = "Shutting Down the Service";
536 instructions = "Fill out this form to shut down the service.";
538 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };
539 { name = "delay", type = "list-single", label = "Time delay before shutting down",
540 value = { {label = "30 seconds", value = "30"},
541 {label = "60 seconds", value = "60"},
542 {label = "90 seconds", value = "90"},
543 {label = "2 minutes", value = "120"},
544 {label = "3 minutes", value = "180"},
545 {label = "4 minutes", value = "240"},
546 {label = "5 minutes", value = "300"},
549 { name = "announcement", type = "text-multi", label = "Announcement" };
553 if data.action == "cancel" then
554 return { status = "canceled" };
557 local fields, err = shut_down_service_layout:data(data.form);
560 return generate_error_message(err);
563 if fields.announcement and #fields.announcement > 0 then
564 local message = st.message({type = "headline"}, fields.announcement):up()
565 :tag("subject"):text("Server is shutting down");
566 send_to_online(message);
569 timer_add_task(tonumber(fields.delay or "5"), prosody.shutdown);
571 return { status = "completed", info = "Server is about to shut down" };
573 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = shut_down_service_layout }, "executing";
577 function unload_modules_handler(self, data, state)
578 local layout = dataforms_new {
579 title = "Unload modules";
580 instructions = "Select the modules to be unloaded";
582 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/modules#unload" };
583 { name = "modules", type = "list-multi", required = true, label = "Modules to be unloaded:"};
586 if data.action == "cancel" then
587 return { status = "canceled" };
589 local fields, err = layout:data(data.form);
591 return generate_error_message(err);
593 local ok_list, err_list = {}, {};
594 for _, module in ipairs(fields.modules) do
595 local ok, err = modulemanager.unload(data.to, module);
597 ok_list[#ok_list + 1] = module;
599 err_list[#err_list + 1] = module .. "(Error: " .. tostring(err) .. ")";
602 local info = (#ok_list > 0 and ("The following modules were successfully unloaded on host "..data.to..":\n"..t_concat(ok_list, "\n")) or "")..
603 (#err_list > 0 and ("Failed to unload the following modules on host "..data.to..":\n"..t_concat(err_list, "\n")) or "");
604 return { status = "completed", info = info };
606 local modules = array.collect(keys(hosts[data.to].modules)):sort();
607 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing";
611 function activate_host_handler(self, data, state)
612 local layout = dataforms_new {
613 title = "Activate host";
616 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/hosts#activate" };
617 { name = "host", type = "text-single", required = true, label = "Host:"};
620 if data.action == "cancel" then
621 return { status = "canceled" };
623 local fields, err = layout:data(data.form);
625 return generate_error_message(err);
627 local ok, err = hostmanager_activate(fields.host);
630 return { status = "completed", info = fields.host .. " activated" };
632 return { status = "canceled", error = err }
635 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout } }, "executing";
639 function deactivate_host_handler(self, data, state)
640 local layout = dataforms_new {
641 title = "Deactivate host";
644 { name = "FORM_TYPE", type = "hidden", value = "http://prosody.im/protocol/hosts#activate" };
645 { name = "host", type = "text-single", required = true, label = "Host:"};
648 if data.action == "cancel" then
649 return { status = "canceled" };
651 local fields, err = layout:data(data.form);
653 return generate_error_message(err);
655 local ok, err = hostmanager_deactivate(fields.host);
658 return { status = "completed", info = fields.host .. " deactivated" };
660 return { status = "canceled", error = err }
663 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout } }, "executing";
668 local add_user_desc = adhoc_new("Add User", "http://jabber.org/protocol/admin#add-user", add_user_command_handler, "admin");
669 local change_user_password_desc = adhoc_new("Change User Password", "http://jabber.org/protocol/admin#change-user-password", change_user_password_command_handler, "admin");
670 local config_reload_desc = adhoc_new("Reload configuration", "http://prosody.im/protocol/config#reload", config_reload_handler, "global_admin");
671 local delete_user_desc = adhoc_new("Delete User", "http://jabber.org/protocol/admin#delete-user", delete_user_command_handler, "admin");
672 local end_user_session_desc = adhoc_new("End User Session", "http://jabber.org/protocol/admin#end-user-session", end_user_session_handler, "admin");
673 local get_user_password_desc = adhoc_new("Get User Password", "http://jabber.org/protocol/admin#get-user-password", get_user_password_handler, "admin");
674 local get_user_roster_desc = adhoc_new("Get User Roster","http://jabber.org/protocol/admin#get-user-roster", get_user_roster_handler, "admin");
675 local get_user_stats_desc = adhoc_new("Get User Statistics","http://jabber.org/protocol/admin#user-stats", get_user_stats_handler, "admin");
676 local get_online_users_desc = adhoc_new("Get List of Online Users", "http://jabber.org/protocol/admin#get-online-users", get_online_users_command_handler, "admin");
677 local list_modules_desc = adhoc_new("List loaded modules", "http://prosody.im/protocol/modules#list", list_modules_handler, "admin");
678 local load_module_desc = adhoc_new("Load module", "http://prosody.im/protocol/modules#load", load_module_handler, "admin");
679 local reload_modules_desc = adhoc_new("Reload modules", "http://prosody.im/protocol/modules#reload", reload_modules_handler, "admin");
680 local shut_down_service_desc = adhoc_new("Shut Down Service", "http://jabber.org/protocol/admin#shutdown", shut_down_service_handler, "global_admin");
681 local unload_modules_desc = adhoc_new("Unload modules", "http://prosody.im/protocol/modules#unload", unload_modules_handler, "admin");
682 local activate_host_desc = adhoc_new("Activate host", "http://prosody.im/protocol/hosts#activate", activate_host_handler, "global_admin");
683 local deactivate_host_desc = adhoc_new("Deactivate host", "http://prosody.im/protocol/hosts#deactivate", deactivate_host_handler, "global_admin");
685 module:provides("adhoc", add_user_desc);
686 module:provides("adhoc", change_user_password_desc);
687 module:provides("adhoc", config_reload_desc);
688 module:provides("adhoc", delete_user_desc);
689 module:provides("adhoc", end_user_session_desc);
690 module:provides("adhoc", get_user_password_desc);
691 module:provides("adhoc", get_user_roster_desc);
692 module:provides("adhoc", get_user_stats_desc);
693 module:provides("adhoc", get_online_users_desc);
694 module:provides("adhoc", list_modules_desc);
695 module:provides("adhoc", load_module_desc);
696 module:provides("adhoc", reload_modules_desc);
697 module:provides("adhoc", shut_down_service_desc);
698 module:provides("adhoc", unload_modules_desc);
699 module:provides("adhoc", activate_host_desc);
700 module:provides("adhoc", deactivate_host_desc);