mod_register: Small code cleanup
authorMatthew Wild <mwild1@gmail.com>
Tue, 04 Jan 2011 17:21:58 +0000
changeset 3997 678e0688c18c
parent 3996 7f35b292531b
child 3998 009d1ad84b49
mod_register: Small code cleanup
plugins/mod_register.lua
--- a/plugins/mod_register.lua	Tue Jan 04 17:19:39 2011 +0000
+++ b/plugins/mod_register.lua	Tue Jan 04 17:21:58 2011 +0000
@@ -71,12 +71,9 @@
 			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));