Software / code / prosody
Comparison
plugins/mod_register.lua @ 4063:925a27f15a60
mod_register: Small code cleanup
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 04 Jan 2011 17:21:58 +0000 |
| parent | 4062:73d570890a1b |
| child | 4268:c249f10eb9bb |
comparison
equal
deleted
inserted
replaced
| 4062:73d570890a1b | 4063:925a27f15a60 |
|---|---|
| 69 datamanager.store(username, host, "roster", nil); | 69 datamanager.store(username, host, "roster", nil); |
| 70 datamanager.store(username, host, "privacy", nil); | 70 datamanager.store(username, host, "privacy", nil); |
| 71 module:log("info", "User removed their account: %s@%s", username, host); | 71 module:log("info", "User removed their account: %s@%s", username, host); |
| 72 module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session }); | 72 module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session }); |
| 73 else | 73 else |
| 74 local username = query:child_with_name("username"); | 74 local username = nodeprep(query:get_child("username"):get_text()); |
| 75 local password = query:child_with_name("password"); | 75 local password = query:get_child("password"):get_text(); |
| 76 if username and password then | 76 if username and password then |
| 77 -- FIXME shouldn't use table.concat | |
| 78 username = nodeprep(table.concat(username)); | |
| 79 password = table.concat(password); | |
| 80 if username == session.username then | 77 if username == session.username then |
| 81 if usermanager_set_password(username, password, session.host) then | 78 if usermanager_set_password(username, password, session.host) then |
| 82 session.send(st.reply(stanza)); | 79 session.send(st.reply(stanza)); |
| 83 else | 80 else |
| 84 -- TODO unable to write file, file may be locked, etc, what's the correct error? | 81 -- TODO unable to write file, file may be locked, etc, what's the correct error? |