Changeset

3997:678e0688c18c

mod_register: Small code cleanup
author Matthew Wild <mwild1@gmail.com>
date Tue, 04 Jan 2011 17:21:58 +0000
parents 3996:7f35b292531b
children 3998:009d1ad84b49
files plugins/mod_register.lua
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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));