mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 22:43:20 -05:00
Add config method
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
600c7c5e8f
commit
c00680f631
@ -16,6 +16,10 @@ public class FontFunCaptcha implements ChallengeProvider {
|
||||
return "FontFunCaptcha";
|
||||
}
|
||||
|
||||
public void configure(String config) {
|
||||
// TODO: Add custom config
|
||||
}
|
||||
|
||||
private String getFontName(String path, String level) {
|
||||
File file = new File(path + level + "/");
|
||||
FilenameFilter txtFileFilter =
|
||||
|
@ -48,6 +48,10 @@ public class GifCaptcha implements ChallengeProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void configure(String config) {
|
||||
// TODO: Add custom config
|
||||
}
|
||||
|
||||
public Challenge returnChallenge() {
|
||||
String secret = HelperFunctions.randomString(6);
|
||||
return new Challenge(gifCaptcha(secret), "image/gif", secret.toLowerCase());
|
||||
|
@ -20,6 +20,10 @@ public class ShadowTextCaptcha implements ChallengeProvider {
|
||||
return "ShadowTextCaptcha";
|
||||
}
|
||||
|
||||
public void configure(String config) {
|
||||
// TODO: Add custom config
|
||||
}
|
||||
|
||||
public boolean checkAnswer(String secret, String answer) {
|
||||
return answer.toLowerCase().equals(secret);
|
||||
}
|
||||
|
@ -7,5 +7,5 @@ public interface ChallengeProvider {
|
||||
|
||||
public boolean checkAnswer(String secret, String answer);
|
||||
|
||||
// TODO: def configure(): Unit
|
||||
public void configure(String config);
|
||||
}
|
||||
|
@ -10,6 +10,11 @@ import lc.captchas.interfaces.Challenge
|
||||
|
||||
class FilterChallenge extends ChallengeProvider {
|
||||
def getId = "FilterChallenge"
|
||||
|
||||
def configure(config: String): Unit = {
|
||||
// TODO: add custom config
|
||||
}
|
||||
|
||||
def returnChallenge(): Challenge = {
|
||||
val filterTypes = List(new FilterType1, new FilterType2)
|
||||
val r = new scala.util.Random
|
||||
|
@ -23,6 +23,10 @@ class LabelCaptcha extends ChallengeProvider {
|
||||
|
||||
def getId = "LabelCaptcha"
|
||||
|
||||
def configure(config: String): Unit = {
|
||||
// TODO: add custom config
|
||||
}
|
||||
|
||||
def returnChallenge(): Challenge =
|
||||
synchronized {
|
||||
val r = scala.util.Random.nextInt(knownFiles.length)
|
||||
|
@ -31,6 +31,10 @@ class RainDropsCP extends ChallengeProvider {
|
||||
|
||||
def getId = "FilterChallenge"
|
||||
|
||||
def configure(config: String): Unit = {
|
||||
// TODO: add custom config
|
||||
}
|
||||
|
||||
private def extendDrops(drops: Array[Drop], steps: Int, xOffset: Int) = {
|
||||
drops.map(d => {
|
||||
val nd = new Drop()
|
||||
|
Loading…
Reference in New Issue
Block a user