# HG changeset patch # User Matthew Wild # Date 1294161718 0 # Node ID 678e0688c18c215bc447af5e750384cf212039cd # Parent 7f35b292531b8fccbe29dab10321be585400cb27 mod_register: Small code cleanup diff -r 7f35b292531b -r 678e0688c18c 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));