Software / code / prosody
Comparison
plugins/mod_register.lua @ 6297:5b298a6ecf0c
mod_register: get_child_text! (thanks Lloyd)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 03 Jul 2014 17:53:24 +0200 |
| parent | 5500:eeea0eb2602a |
| child | 5707:36a289e9244c |
| child | 7916:72b6d5ab4137 |
comparison
equal
deleted
inserted
replaced
| 6288:d122420542fb | 6297:5b298a6ecf0c |
|---|---|
| 113 end | 113 end |
| 114 | 114 |
| 115 module:log("info", "User removed their account: %s@%s", username, host); | 115 module:log("info", "User removed their account: %s@%s", username, host); |
| 116 module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session }); | 116 module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session }); |
| 117 else | 117 else |
| 118 local username = nodeprep(query:get_child("username"):get_text()); | 118 local username = nodeprep(query:get_child_text("username")); |
| 119 local password = query:get_child("password"):get_text(); | 119 local password = query:get_child_text("password"); |
| 120 if username and password then | 120 if username and password then |
| 121 if username == session.username then | 121 if username == session.username then |
| 122 if usermanager_set_password(username, password, session.host) then | 122 if usermanager_set_password(username, password, session.host) then |
| 123 session.send(st.reply(stanza)); | 123 session.send(st.reply(stanza)); |
| 124 else | 124 else |