aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_register.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-10-01 20:15:39 +0100
committerMatthew Wild <mwild1@gmail.com>2012-10-01 20:15:39 +0100
commit38f89dfe3fb1cff7b6f7dc873881dc439990eb33 (patch)
treeab1b1beb73f5375a5e05b02e7aed01cdb3cf512c /plugins/mod_register.lua
parentf668985503c28905145fc31475e935e175ab2ad7 (diff)
parent39cfeeebc208a6a6b85e1e2353171c73e77c3cd7 (diff)
downloadprosody-38f89dfe3fb1cff7b6f7dc873881dc439990eb33.tar.gz
prosody-38f89dfe3fb1cff7b6f7dc873881dc439990eb33.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_register.lua')
-rw-r--r--plugins/mod_register.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua
index dfc8c49b..b3abd394 100644
--- a/plugins/mod_register.lua
+++ b/plugins/mod_register.lua
@@ -223,6 +223,12 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event)
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