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

vault/0.11
Waqas Hussain 16 years ago
parent ccf63862c5
commit 52cfde2f6e
  1. 2
      plugins/mod_register.lua

@ -141,7 +141,7 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s
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."));

Loading…
Cancel
Save