Block userids make up of just sdfg in any order and just those characters.

ignore .idea folder
This commit is contained in:
Larry Shatzer, Jr 2016-01-22 11:09:20 -07:00
parent 4235ee98e1
commit 5865c26b12
2 changed files with 11 additions and 1 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
*.iws
target
config.properties
bin/jetty-runner.jar
bin/jetty-runner.jar
.idea

View File

@ -160,6 +160,10 @@ public class Application {
return maybeSpammer(userid, firstName, lastName, email, ip, "Blacklist");
}
if(badUserId(userid)) {
return maybeSpammer(userid, firstName, lastName, email, ip, "badUserId");
}
if(circuitBreaker.check()) {
return maybeSpammer(userid, firstName, lastName, email, ip, "circuitBreaker");
}
@ -182,6 +186,10 @@ public class Application {
return new HttpRedirect("doneMail");
}
private boolean badUserId(String userid) {
return Pattern.matches("^[sdfg]+$", userid.toLowerCase());
}
private boolean verifyCaptcha(String uresponse, String ip) {
String postParams = "secret=" + URLEncoder.encode(params.recaptchaPrivateKey()) +
"&remoteip=" + URLEncoder.encode(ip) +
@ -556,6 +564,7 @@ public class Application {
public static final List<String> EMAIL_BLACKLIST = Arrays.asList(
"@clrmail.com",
"@guerrillamail.com",
"@mailcatch.com",
"@maildx.com",
"@mailinator.com",
"@mailnesia.com",