Changeset

551:859bf77b9fbf

mod_register_json: fire user-registered event manually on the destination host. (thanks Mr. Gecko)
author Marco Cirillo <maranda@lightwitch.org>
date Sat, 14 Jan 2012 21:45:37 +0000
parents 550:d8143f627f9f
children 552:d1e83cb12885
files mod_register_json/mod_register_json.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_register_json/mod_register_json.lua	Sat Jan 14 19:56:24 2012 +0000
+++ b/mod_register_json/mod_register_json.lua	Sat Jan 14 21:45:37 2012 +0000
@@ -97,7 +97,8 @@
 					return http_response(406, "Supplied username contains invalid characters, see RFC 6122.")
 				else
 					usermanager.create_user(username, req_body["password"], req_body["host"])
-					module:log("debug", "%s registration data submission for %s is successful", user, username)
+					hosts[req_body["host"]].events.fire_event("user-registered", { username = username, host = req_body["host"], source = "mod_register_json", session = { ip = req_body["ip"] } })
+					module:log("debug", "%s registration data submission for %s@%s is successful", user, username, req_body["host"])
 					return http_response(200, "Done.")
 				end
 			else