comparison plugins/mod_user_account_management.lua @ 11200:bf8f2da84007

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 05 Nov 2020 22:31:25 +0100
parents fcdc65bc6697
children 74b9e05af71e
comparison
equal deleted inserted replaced
11199:6c7c50a4de32 11200:bf8f2da84007
51 end 51 end
52 52
53 log("info", "User removed their account: %s@%s", username, host); 53 log("info", "User removed their account: %s@%s", username, host);
54 module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session }); 54 module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session });
55 else 55 else
56 local username = nodeprep(query:get_child_text("username")); 56 local username = query:get_child_text("username");
57 local password = query:get_child_text("password"); 57 local password = query:get_child_text("password");
58 if username and password then 58 if username and password then
59 username = nodeprep(username);
59 if username == session.username then 60 if username == session.username then
60 if usermanager_set_password(username, password, session.host, session.resource) then 61 if usermanager_set_password(username, password, session.host, session.resource) then
61 session.send(st.reply(stanza)); 62 session.send(st.reply(stanza));
62 else 63 else
63 -- TODO unable to write file, file may be locked, etc, what's the correct error? 64 -- TODO unable to write file, file may be locked, etc, what's the correct error?