aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_invites.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_invites.lua')
-rw-r--r--plugins/mod_invites.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/mod_invites.lua b/plugins/mod_invites.lua
index 881b851e..34720a51 100644
--- a/plugins/mod_invites.lua
+++ b/plugins/mod_invites.lua
@@ -1,8 +1,8 @@
-local id = require "util.id";
-local it = require "util.iterators";
+local id = require "prosody.util.id";
+local it = require "prosody.util.iterators";
local url = require "socket.url";
-local jid_node = require "util.jid".node;
-local jid_split = require "util.jid".split;
+local jid_node = require "prosody.util.jid".node;
+local jid_split = require "prosody.util.jid".split;
local default_ttl = module:get_option_number("invite_expiry", 86400 * 7);
@@ -205,7 +205,7 @@ do
-- Since the console is global this overwrites the command for
-- each host it's loaded on, but this should be fine.
- local get_module = require "core.modulemanager".get_module;
+ local get_module = require "prosody.core.modulemanager".get_module;
local console_env = module:shared("/*/admin_shell/env");
@@ -238,8 +238,8 @@ function module.command(arg)
end
table.remove(arg, 1); -- pop command
- local sm = require "core.storagemanager";
- local mm = require "core.modulemanager";
+ local sm = require "prosody.core.storagemanager";
+ local mm = require "prosody.core.modulemanager";
local host = arg[1];
assert(prosody.hosts[host], "Host "..tostring(host).." does not exist");
@@ -257,7 +257,7 @@ function module.command(arg)
end
local allow_reset;
- local roles;
+ local roles = {};
local groups = {};
while #arg > 0 do
@@ -282,13 +282,13 @@ function module.command(arg)
print(" --group GROUPID Add the user to the group with the given ID")
print(" Can be specified multiple times")
print()
- print("--role and --admin override each other; the last one wins")
+ print("--role and --admin can be specified multiple times; the first role becomes the primary role, the rest become secondary roles")
print("--group can be specified multiple times; the user will be added to all groups.")
print()
print("--reset and the other options cannot be mixed.")
return 2
elseif value == "--reset" then
- local nodeprep = require "util.encodings".stringprep.nodeprep;
+ local nodeprep = require "prosody.util.encodings".stringprep.nodeprep;
local username = nodeprep(arg[1])
table.remove(arg, 1);
if not username then
@@ -297,14 +297,14 @@ function module.command(arg)
end
allow_reset = username;
elseif value == "--admin" then
- roles = { ["prosody:admin"] = true };
+ table.insert(roles, "prosody:admin");
elseif value == "--role" then
local rolename = arg[1];
if not rolename then
print("Please supply a role name");
return 2;
end
- roles = { [rolename] = true };
+ table.insert(roles, rolename);
table.remove(arg, 1);
elseif value == "--group" or value == "-g" then
local groupid = arg[1];
@@ -321,7 +321,7 @@ function module.command(arg)
local invite;
if allow_reset then
- if roles then
+ if roles[1] then
print("--role/--admin and --reset are mutually exclusive")
return 2;
end