Comparison

plugins/mod_register_ibr.lua @ 8583:9918f324a0be

mod_register_ibr: Include reason for rejection of registration in debug log
author Kim Alvefur <zash@zash.se>
date Sat, 10 Mar 2018 02:21:23 +0100
parent 8488:95706e0f19fc
child 8736:a071c203a1a0
comparison
equal deleted inserted replaced
8582:6a2366759974 8583:9918f324a0be
144 return true; 144 return true;
145 end 145 end
146 local user = { username = username , host = host, additional = data, ip = session.ip, session = session, allowed = true } 146 local user = { username = username , host = host, additional = data, ip = session.ip, session = session, allowed = true }
147 module:fire_event("user-registering", user); 147 module:fire_event("user-registering", user);
148 if not user.allowed then 148 if not user.allowed then
149 log("debug", "Registration disallowed by module"); 149 log("debug", "Registration disallowed by module: %s", user.reason or "no reason given");
150 session.send(st.error_reply(stanza, "modify", "not-acceptable", user.reason)); 150 session.send(st.error_reply(stanza, "modify", "not-acceptable", user.reason));
151 elseif usermanager_user_exists(username, host) then 151 elseif usermanager_user_exists(username, host) then
152 log("debug", "Attempt to register with existing username"); 152 log("debug", "Attempt to register with existing username");
153 session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists.")); 153 session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists."));
154 else 154 else