aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-03-26 16:45:34 +0200
committerKim Alvefur <zash@zash.se>2023-03-26 16:45:34 +0200
commit8720067f241ebc2a23b4d5ab9fb68beba9e61d53 (patch)
treeb9bea000654e66455751c743f758c18e0196b9be /plugins
parent1d6989afb1a42f23b3dc1b1d39162d8fa3163996 (diff)
downloadprosody-8720067f241ebc2a23b4d5ab9fb68beba9e61d53.tar.gz
prosody-8720067f241ebc2a23b4d5ab9fb68beba9e61d53.zip
mod_admin_shell: Enable user after creation with role
Fixes that otherwise the user was created in a disabled state and left as such.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_shell.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index 8c6bab9d..c652fa96 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -1533,6 +1533,11 @@ function def_env.user:create(jid, password, role)
if not ok then
return nil, "Could not set password for user: "..err;
end
+
+ local ok, err = um.enable_user(username, host);
+ if not ok and err ~= "method-not-implemented" then
+ return nil, "Could not enable user: "..err;
+ end
end
else
local ok, err = um.create_user(username, password, host);