diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-05-19 11:53:34 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-05-19 11:53:34 +0100 |
commit | aa714c10d6cf5845dc43da333b3a85017d9365e7 (patch) | |
tree | fac45704a3dd7cfbd9fc9d1a646a8226f0038fb2 | |
parent | 05afac6dadc80607cd949cf5ba01ca53f119cccd (diff) | |
download | prosody-aa714c10d6cf5845dc43da333b3a85017d9365e7.tar.gz prosody-aa714c10d6cf5845dc43da333b3a85017d9365e7.zip |
mod_register: Fire events and log on account creation/deletion
-rw-r--r-- | plugins/mod_register.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 14c00767..417e36bd 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -60,6 +60,8 @@ module:add_iq_handler("c2s", "jabber:iq:register", function (session, stanza) end end datamanager.store(username, host, "accounts", nil); -- delete accounts datastore at the end + module:log("info", "User removed their account: %s@%s", username, host); + module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register" }); else local username = query:child_with_name("username"); local password = query:child_with_name("password"); @@ -143,6 +145,9 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s else if usermanager_create_user(username, password, session.host) then session.send(st.reply(stanza)); -- user created! + module:log("info", "User account created: %s@%s", username, session.host); + module:fire_event("user-registered", { + username = username, host = session.host, source = "mod_register" }); else -- TODO unable to write file, file may be locked, etc, what's the correct error? session.send(st.error_reply(stanza, "wait", "internal-server-error")); |