mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-13 06:53:19 -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";
|
return "FontFunCaptcha";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void configure(String config) {
|
||||||
|
// TODO: Add custom config
|
||||||
|
}
|
||||||
|
|
||||||
private String getFontName(String path, String level) {
|
private String getFontName(String path, String level) {
|
||||||
File file = new File(path + level + "/");
|
File file = new File(path + level + "/");
|
||||||
FilenameFilter txtFileFilter =
|
FilenameFilter txtFileFilter =
|
||||||
|
@ -48,6 +48,10 @@ public class GifCaptcha implements ChallengeProvider {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void configure(String config) {
|
||||||
|
// TODO: Add custom config
|
||||||
|
}
|
||||||
|
|
||||||
public Challenge returnChallenge() {
|
public Challenge returnChallenge() {
|
||||||
String secret = HelperFunctions.randomString(6);
|
String secret = HelperFunctions.randomString(6);
|
||||||
return new Challenge(gifCaptcha(secret), "image/gif", secret.toLowerCase());
|
return new Challenge(gifCaptcha(secret), "image/gif", secret.toLowerCase());
|
||||||
|
@ -20,6 +20,10 @@ public class ShadowTextCaptcha implements ChallengeProvider {
|
|||||||
return "ShadowTextCaptcha";
|
return "ShadowTextCaptcha";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void configure(String config) {
|
||||||
|
// TODO: Add custom config
|
||||||
|
}
|
||||||
|
|
||||||
public boolean checkAnswer(String secret, String answer) {
|
public boolean checkAnswer(String secret, String answer) {
|
||||||
return answer.toLowerCase().equals(secret);
|
return answer.toLowerCase().equals(secret);
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,5 @@ public interface ChallengeProvider {
|
|||||||
|
|
||||||
public boolean checkAnswer(String secret, String answer);
|
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 {
|
class FilterChallenge extends ChallengeProvider {
|
||||||
def getId = "FilterChallenge"
|
def getId = "FilterChallenge"
|
||||||
|
|
||||||
|
def configure(config: String): Unit = {
|
||||||
|
// TODO: add custom config
|
||||||
|
}
|
||||||
|
|
||||||
def returnChallenge(): Challenge = {
|
def returnChallenge(): Challenge = {
|
||||||
val filterTypes = List(new FilterType1, new FilterType2)
|
val filterTypes = List(new FilterType1, new FilterType2)
|
||||||
val r = new scala.util.Random
|
val r = new scala.util.Random
|
||||||
|
@ -23,6 +23,10 @@ class LabelCaptcha extends ChallengeProvider {
|
|||||||
|
|
||||||
def getId = "LabelCaptcha"
|
def getId = "LabelCaptcha"
|
||||||
|
|
||||||
|
def configure(config: String): Unit = {
|
||||||
|
// TODO: add custom config
|
||||||
|
}
|
||||||
|
|
||||||
def returnChallenge(): Challenge =
|
def returnChallenge(): Challenge =
|
||||||
synchronized {
|
synchronized {
|
||||||
val r = scala.util.Random.nextInt(knownFiles.length)
|
val r = scala.util.Random.nextInt(knownFiles.length)
|
||||||
|
@ -31,6 +31,10 @@ class RainDropsCP extends ChallengeProvider {
|
|||||||
|
|
||||||
def getId = "FilterChallenge"
|
def getId = "FilterChallenge"
|
||||||
|
|
||||||
|
def configure(config: String): Unit = {
|
||||||
|
// TODO: add custom config
|
||||||
|
}
|
||||||
|
|
||||||
private def extendDrops(drops: Array[Drop], steps: Int, xOffset: Int) = {
|
private def extendDrops(drops: Array[Drop], steps: Int, xOffset: Int) = {
|
||||||
drops.map(d => {
|
drops.map(d => {
|
||||||
val nd = new Drop()
|
val nd = new Drop()
|
||||||
|
Loading…
Reference in New Issue
Block a user