This commit is contained in:
Alicia 2019-02-23 16:30:40 +00:00
parent 67920c842b
commit 2b1589c255

View File

@ -93,8 +93,8 @@ func registerSubmit(c *gin.Context) {
registerResp(c, errorMessage{T(c, "Captcha is invalid.")})
return
}
fmt.Printf("%s", cmd5(c.PostForm("key"))
if db.QueryRow("SELECT * FROM beta_keys WHERE key_md5 = ? AND allowed = 1", cmd5(c.PostForm("key"))).
fmt.Printf("%s", cmd5(c.PostForm("key")))
if db.QueryRow("SELECT 1 FROM beta_keys WHERE key_md5 = ? AND allowed = 1", cmd5(c.PostForm("key"))).
Scan(new(int)) != sql.ErrNoRows {
registerResp(c, errorMessage{T(c, "Invalid Beta Key.")})
return