Moved password checks with the others

This commit is contained in:
Maxetto 2015-07-10 16:15:12 +02:00
parent 979c1f2528
commit e63764e585

View File

@ -52,15 +52,27 @@ public class AsyncronousRegister {
allowRegister = false;
}
else if ((lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null")) || !lowpass.matches(Settings.getPassRegex)) {
else if (lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null") || !lowpass.matches(Settings.getPassRegex)) {
m.send(player, "password_error");
allowRegister = false;
}
else if ((lowpass.equalsIgnoreCase(player.getName()))) {
else if (lowpass.equalsIgnoreCase(player.getName())) {
m.send(player, "password_error_nick");
allowRegister = false;
}
else if (password.length() < Settings.getPasswordMinLen || password.length() > Settings.passwordMaxLength) {
m.send(player, "pass_len");
allowRegister = false;
}
else if (!Settings.unsafePasswords.isEmpty()) {
if (Settings.unsafePasswords.contains(password.toLowerCase())) {
m.send(player, "password_error_unsafe");
allowRegister = false;
}
}
else if (database.isAuthAvailable(name)) {
m.send(player, "user_regged");
@ -125,16 +137,6 @@ public class AsyncronousRegister {
}
protected void passwordRegister() {
if (password.length() < Settings.getPasswordMinLen || password.length() > Settings.passwordMaxLength) {
m.send(player, "pass_len");
return;
}
if (!Settings.unsafePasswords.isEmpty()) {
if (Settings.unsafePasswords.contains(password.toLowerCase())) {
m.send(player, "password_error_unsafe");
return;
}
}
PlayerAuth auth = null;
String hash = "";
try {