Merge 0.8->trunk.
[prosody.git] / plugins / mod_register.lua
index 7373adadb985d6953a996ba12bf89c4e916d4e6b..25c09dfa69a2c0013bd5e474a04ccb50348c7913 100644 (file)
@@ -71,12 +71,9 @@ local function handle_registration_stanza(event)
                        module:log("info", "User removed their account: %s@%s", username, host);
                        module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session });
                else
-                       local username = query:child_with_name("username");
-                       local password = query:child_with_name("password");
+                       local username = nodeprep(query:get_child("username"):get_text());
+                       local password = query:get_child("password"):get_text();
                        if username and password then
-                               -- FIXME shouldn't use table.concat
-                               username = nodeprep(table.concat(username));
-                               password = table.concat(password);
                                if username == session.username then
                                        if usermanager_set_password(username, password, session.host) then
                                                session.send(st.reply(stanza));