# HG changeset patch # User Florian Zeitz # Date 1343936520 -7200 # Node ID 88fb94df9b182e0e0a6bf9c8189b556295a1cf9e # Parent 4d939d2b1574d287cb1aa4c7c8803bbfed8ffa0e mod_admin_adhoc, mod_announce: Explicitly specify possible actions for ad-hoc commands diff -r 4d939d2b1574 -r 88fb94df9b18 plugins/mod_admin_adhoc.lua --- a/plugins/mod_admin_adhoc.lua Thu Aug 02 21:28:14 2012 +0200 +++ b/plugins/mod_admin_adhoc.lua Thu Aug 02 21:42:00 2012 +0200 @@ -75,7 +75,7 @@ return { status = "completed", error = { message = "Invalid data.\nPassword mismatch, or empty username" } }; end else - return { status = "executing", form = add_user_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = add_user_layout }, "executing"; end end @@ -107,7 +107,7 @@ return { status = "completed", error = { message = "User does not exist" } }; end else - return { status = "executing", form = change_user_password_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = change_user_password_layout }, "executing"; end end @@ -155,7 +155,7 @@ (#failed ~= 0 and "The following accounts could not be deleted:\n"..t_concat(failed, "\n") or "") }; else - return { status = "executing", form = delete_user_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = delete_user_layout }, "executing"; end end @@ -205,7 +205,7 @@ (#failed ~= 0 and "The following accounts could not be disconnected:\n"..t_concat(failed, "\n") or "") }; else - return { status = "executing", form = end_user_session_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = end_user_session_layout }, "executing"; end end @@ -254,7 +254,7 @@ end return { status = "completed", result = { layout = get_user_password_result_layout, values = {accountjid = accountjid, password = password} } }; else - return { status = "executing", form = get_user_password_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_user_password_layout }, "executing"; end end @@ -312,7 +312,7 @@ result:add_child(query); return { status = "completed", other = result }; else - return { status = "executing", form = get_user_roster_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_user_roster_layout }, "executing"; end end @@ -365,7 +365,7 @@ return { status = "completed", result = {layout = get_user_stats_result_layout, values = {ipaddresses = IPs, rostersize = tostring(rostersize), onlineresources = resources}} }; else - return { status = "executing", form = get_user_stats_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_user_stats_layout }, "executing"; end end @@ -425,7 +425,7 @@ end return { status = "completed", result = {layout = get_online_users_result_layout, values = {onlineuserjids=t_concat(users, "\n")}} }; else - return { status = "executing", form = get_online_users_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = get_online_users_layout }, "executing"; end end @@ -469,7 +469,7 @@ '". Error was: "'..tostring(err or "")..'"' } }; end else - return { status = "executing", form = layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = layout }, "executing"; end end @@ -503,7 +503,7 @@ return { status = "completed", info = info }; else local modules = array.collect(keys(hosts[data.to].modules)):sort(); - return { status = "executing", form = { layout = layout; values = { modules = modules } } }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing"; end end @@ -567,7 +567,7 @@ return { status = "completed", info = "Server is about to shut down" }; else - return { status = "executing", form = shut_down_service_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = shut_down_service_layout }, "executing"; end end @@ -601,7 +601,7 @@ return { status = "completed", info = info }; else local modules = array.collect(keys(hosts[data.to].modules)):sort(); - return { status = "executing", form = { layout = layout; values = { modules = modules } } }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing"; end end diff -r 4d939d2b1574 -r 88fb94df9b18 plugins/mod_announce.lua --- a/plugins/mod_announce.lua Thu Aug 02 21:28:14 2012 +0200 +++ b/plugins/mod_announce.lua Thu Aug 02 21:42:00 2012 +0200 @@ -88,7 +88,7 @@ module:log("info", "Announcement sent to %d online users", count); return { status = "completed", info = ("Announcement sent to %d online users"):format(count) }; else - return { status = "executing", form = announce_layout }, "executing"; + return { status = "executing", actions = {"next", "complete", default = "complete"}, form = announce_layout }, "executing"; end return true;