# HG changeset patch # User Kim Alvefur # Date 1345851109 -7200 # Node ID 65207b768f60b7aef47a075607d12b0a5a49f940 # Parent 39eb688e106a89c73af441cd4598783f7752a809 mod_admin_adhoc: Use usermanager.delete_user to delete users diff -r 39eb688e106a -r 65207b768f60 plugins/mod_admin_adhoc.lua --- a/plugins/mod_admin_adhoc.lua Sat Aug 25 01:31:05 2012 +0200 +++ b/plugins/mod_admin_adhoc.lua Sat Aug 25 01:31:49 2012 +0200 @@ -14,6 +14,7 @@ local keys, values = iterators.keys, iterators.values; local usermanager_user_exists = require "core.usermanager".user_exists; local usermanager_create_user = require "core.usermanager".create_user; +local usermanager_delete_user = require "core.usermanager".delete_user; local usermanager_get_password = require "core.usermanager".get_password; local usermanager_set_password = require "core.usermanager".set_password; local is_admin = require "core.usermanager".is_admin; @@ -142,7 +143,7 @@ local succeeded = {}; for _, aJID in ipairs(fields.accountjids) do local username, host, resource = jid.split(aJID); - if (host == data.to) and usermanager_user_exists(username, host) and disconnect_user(aJID) and usermanager_create_user(username, nil, host) then + if (host == data.to) and usermanager_user_exists(username, host) and usermanager_delete_user(username, host) then module:log("debug", "User %s has been deleted", aJID); succeeded[#succeeded+1] = aJID; else