mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 22:43:20 -05:00
renaming and removal of unused code
This commit is contained in:
parent
1d7ef512bd
commit
f08f6041ec
@ -13,7 +13,7 @@ class DBConn(){
|
||||
lazy val userPstmt: PreparedStatement = con.prepareStatement("INSERT INTO users(email, hash) VALUES (?,?)")
|
||||
lazy val validatePstmt: PreparedStatement = con.prepareStatement("SELECT hash FROM users WHERE hash = ? LIMIT 1")
|
||||
|
||||
def getConn(): Statement = {
|
||||
def getStatement(): Statement = {
|
||||
con.createStatement()
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ case class ProviderSecret(provider: String, secret: String)
|
||||
|
||||
class Captcha(throttle: Int) extends DBConn {
|
||||
|
||||
val stmt = getConn()
|
||||
val stmt = getStatement()
|
||||
stmt.execute("CREATE TABLE IF NOT EXISTS challenge(token varchar, id varchar, secret varchar, provider varchar, contentType varchar, image blob, solved boolean default False, PRIMARY KEY(token))")
|
||||
stmt.execute("CREATE TABLE IF NOT EXISTS mapId(uuid varchar, token varchar, PRIMARY KEY(uuid), FOREIGN KEY(token) REFERENCES challenge(token))")
|
||||
stmt.execute("CREATE TABLE IF NOT EXISTS users(email varchar, hash int)")
|
||||
|
@ -10,7 +10,6 @@ import lc.HTTPServer._
|
||||
case class Secret(token: Int)
|
||||
|
||||
class RateLimiter extends DBConn {
|
||||
val stmt = getConn()
|
||||
val userLastActive = collection.mutable.Map[Int, Long]()
|
||||
val userAllowance = collection.mutable.Map[Int, Double]()
|
||||
val rate = 8.0
|
||||
|
Loading…
Reference in New Issue
Block a user