mod_register: Return a <not-acceptable/> error on empty usernames (thanks Neustradamus).

Mon, 11 Jan 2010 17:52:28 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 11 Jan 2010 17:52:28 +0500
changeset 2448
542335c8a5bc
parent 2447
9eb539222f22
child 2449
678ca4e9a479

mod_register: Return a <not-acceptable/> error on empty usernames (thanks Neustradamus).

plugins/mod_register.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_register.lua	Mon Jan 11 10:13:02 2010 +0000
+++ b/plugins/mod_register.lua	Mon Jan 11 17:52:28 2010 +0500
@@ -141,7 +141,7 @@
 					username = nodeprep(table.concat(username));
 					password = table.concat(password);
 					local host = module.host;
-					if not username then
+					if not username or username == "" then
 						session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid."));
 					elseif usermanager_user_exists(username, host) then
 						session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists."));

mercurial