Comparison

plugins/mod_register_ibr.lua @ 9453:b6cdadb1175d

mod_register_ibr: Include password in user-registering event, to allow e.g. password policy enforcement
author Matthew Wild <mwild1@gmail.com>
date Tue, 09 Oct 2018 15:01:34 +0100
parent 8737:6d71845bf56f
child 9608:3e44b8dc2cc0
comparison
equal deleted inserted replaced
9452:9d892b2415bf 9453:b6cdadb1175d
156 log("debug", "The requested username is invalid."); 156 log("debug", "The requested username is invalid.");
157 session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid.")); 157 session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid."));
158 return true; 158 return true;
159 end 159 end
160 160
161 local user = { username = username , host = host, additional = data, ip = session.ip, session = session, allowed = true } 161 local user = { username = username, password = password, host = host, additional = data, ip = session.ip, session = session, allowed = true }
162 module:fire_event("user-registering", user); 162 module:fire_event("user-registering", user);
163 if not user.allowed then 163 if not user.allowed then
164 log("debug", "Registration disallowed by module: %s", user.reason or "no reason given"); 164 log("debug", "Registration disallowed by module: %s", user.reason or "no reason given");
165 session.send(st.error_reply(stanza, "modify", "not-acceptable", user.reason)); 165 session.send(st.error_reply(stanza, "modify", "not-acceptable", user.reason));
166 return true; 166 return true;