Software / code / prosody
Comparison
plugins/mod_register_ibr.lua @ 10287:a1c0395a59ae
mod_register_ibr: Reminder to maybe use util.error in the future
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 29 Sep 2019 16:22:05 +0200 |
| parent | 10286:23b26a414d71 |
| child | 10290:b2ce3300f26a |
comparison
equal
deleted
inserted
replaced
| 10286:23b26a414d71 | 10287:a1c0395a59ae |
|---|---|
| 166 | 166 |
| 167 local user = { username = username, password = password, host = host, additional = data, ip = session.ip, session = session, allowed = true } | 167 local user = { username = username, password = password, host = host, additional = data, ip = session.ip, session = session, allowed = true } |
| 168 module:fire_event("user-registering", user); | 168 module:fire_event("user-registering", user); |
| 169 if not user.allowed then | 169 if not user.allowed then |
| 170 log("debug", "Registration disallowed by module: %s", user.reason or "no reason given"); | 170 log("debug", "Registration disallowed by module: %s", user.reason or "no reason given"); |
| 171 -- TODO This could use util.error | |
| 171 session.send(st.error_reply(stanza, user.error_type or "modify", user.error_condition or "not-acceptable", user.reason)); | 172 session.send(st.error_reply(stanza, user.error_type or "modify", user.error_condition or "not-acceptable", user.reason)); |
| 172 return true; | 173 return true; |
| 173 end | 174 end |
| 174 | 175 |
| 175 if usermanager_user_exists(username, host) then | 176 if usermanager_user_exists(username, host) then |