From 67920c842bd3e1972f6e13eda97a6fab31647f84 Mon Sep 17 00:00:00 2001 From: Alicia Date: Sat, 23 Feb 2019 16:29:34 +0000 Subject: [PATCH] ddd --- register.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/register.go b/register.go index 6c144c0..3fce2bf 100644 --- a/register.go +++ b/register.go @@ -93,9 +93,9 @@ func registerSubmit(c *gin.Context) { registerResp(c, errorMessage{T(c, "Captcha is invalid.")}) return } - - if db.QueryRow("SELECT * FROM beta_keys WHERE key_md5 = ? AND allowed = 1", cmd5(c.PostForm("key"))) == nil { - fmt.Println(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 * 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 }