Commit d348c622 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Return an error if someone tries to register with no password. JM-809

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5043 b35dd754-fafc-0310-a699-88a17e54d16e
parent bfcd390f
...@@ -319,10 +319,17 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -319,10 +319,17 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
} }
newUser = user; newUser = user;
} }
else { else if (password != null && password.trim().length() > 0) {
// An admin can create new accounts when logged in. // An admin can create new accounts when logged in.
newUser = userManager.createUser(username, password, null, email); newUser = userManager.createUser(username, password, null, email);
} }
else {
// Deny registration of users with no password
reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.not_acceptable);
return reply;
}
} }
} }
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment