# HG changeset patch # User Matthew Wild # Date 1349118939 -3600 # Node ID 72cdc2d4e15ea9c34a2176431923c9927390e679 # Parent 12f5a34380908d7b16998d49dd4b0c2ff696ebda# Parent 39bb9344f194f81c3f0ecb266362c702709db404 Merge 0.9->trunk diff -r 12f5a3438090 -r 72cdc2d4e15e plugins/mod_register.lua --- a/plugins/mod_register.lua Sat Sep 29 17:07:50 2012 +0100 +++ b/plugins/mod_register.lua Mon Oct 01 20:15:39 2012 +0100 @@ -223,6 +223,12 @@ local host = module.host; if not username or username == "" then session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid.")); + return true; + end + local user = { username = username , host = host, allowed = true } + module:fire_event("user-registering", user); + if not user.allowed then + session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is forbidden.")); elseif usermanager_user_exists(username, host) then session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists.")); else