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 |