Software / code / prosody
Comparison
plugins/mod_register.lua @ 7754:560d2e758d4c
mod_register: Record the time of registration in the account details store
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 01 Dec 2016 06:47:03 +0100 |
| parent | 7711:c8130995d4d1 |
| child | 7812:2bc339352dcd |
comparison
equal
deleted
inserted
replaced
| 7753:c276d72d4e17 | 7754:560d2e758d4c |
|---|---|
| 255 session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists.")); | 255 session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists.")); |
| 256 else | 256 else |
| 257 -- TODO unable to write file, file may be locked, etc, what's the correct error? | 257 -- TODO unable to write file, file may be locked, etc, what's the correct error? |
| 258 local error_reply = st.error_reply(stanza, "wait", "internal-server-error", "Failed to write data to disk."); | 258 local error_reply = st.error_reply(stanza, "wait", "internal-server-error", "Failed to write data to disk."); |
| 259 if usermanager_create_user(username, password, host) then | 259 if usermanager_create_user(username, password, host) then |
| 260 data.registered = os.time(); | |
| 260 if next(data) and not account_details:set(username, data) then | 261 if next(data) and not account_details:set(username, data) then |
| 261 log("debug", "Could not store extra details"); | 262 log("debug", "Could not store extra details"); |
| 262 usermanager_delete_user(username, host); | 263 usermanager_delete_user(username, host); |
| 263 session.send(error_reply); | 264 session.send(error_reply); |
| 264 return true; | 265 return true; |