Comparison

plugins/mod_register.lua @ 3296:5f57f2f81c02

mod_register: Don't disable account before deleting it (unnecessary, and can cause problems).
author Waqas Hussain <waqas20@gmail.com>
date Thu, 24 Jun 2010 03:46:52 +0500
parent 2935:4e4d0d899d9d
child 3297:aa3725bbcde5
comparison
equal deleted inserted replaced
3295:8865d1b3dce2 3296:5f57f2f81c02
33 if query.tags[1] and query.tags[1].name == "remove" then 33 if query.tags[1] and query.tags[1].name == "remove" then
34 -- TODO delete user auth data, send iq response, kick all user resources with a <not-authorized/>, delete all user data 34 -- TODO delete user auth data, send iq response, kick all user resources with a <not-authorized/>, delete all user data
35 local username, host = session.username, session.host; 35 local username, host = session.username, session.host;
36 --session.send(st.error_reply(stanza, "cancel", "not-allowed")); 36 --session.send(st.error_reply(stanza, "cancel", "not-allowed"));
37 --return; 37 --return;
38 usermanager_set_password(username, host, nil); -- Disable account 38 --usermanager_set_password(username, host, nil); -- Disable account
39 -- FIXME the disabling currently allows a different user to recreate the account 39 -- FIXME the disabling currently allows a different user to recreate the account
40 -- we should add an in-memory account block mode when we have threading 40 -- we should add an in-memory account block mode when we have threading
41 session.send(st.reply(stanza)); 41 session.send(st.reply(stanza));
42 local roster = session.roster; 42 local roster = session.roster;
43 for _, session in pairs(hosts[host].sessions[username].sessions) do -- disconnect all resources 43 for _, session in pairs(hosts[host].sessions[username].sessions) do -- disconnect all resources