mod_register: get_child_text! (thanks Lloyd)
authorKim Alvefur <zash@zash.se>
Thu, 3 Jul 2014 15:53:24 +0000 (17:53 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 3 Jul 2014 15:53:24 +0000 (17:53 +0200)
plugins/mod_register.lua

index 141a4997966a7448a4b78f0f9a9b929e5206a354..3d7a068c61809c4d8d556bd3f4ca0859ebe32ca8 100644 (file)
@@ -115,8 +115,8 @@ 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 = nodeprep(query:get_child("username"):get_text());
-                       local password = query:get_child("password"):get_text();
+                       local username = nodeprep(query:get_child_text("username"));
+                       local password = query:get_child_text("password");
                        if username and password then
                                if username == session.username then
                                        if usermanager_set_password(username, password, session.host) then