From ce53ca26a8b618d7005a7e22c1353d032fc5a3a1 Mon Sep 17 00:00:00 2001 From: Alicia Date: Sat, 23 Feb 2019 16:21:16 +0000 Subject: [PATCH] Add keys --- register.go | 7 +++++++ templates/register/register.html | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/register.go b/register.go index 282f892..b428952 100644 --- a/register.go +++ b/register.go @@ -94,6 +94,12 @@ func registerSubmit(c *gin.Context) { return } + if !db.QueryRow("SELECT 1 FROM beta_keys WHERE key_md5 = ?", cmd5(c.PostForm("key"))). + Scan(new(int)) != sql.ErrNoRows { + registerResp(c, errorMessage{T(c, "Invalid Beta Key.")}) + return + } + uMulti, criteria := tryBotnets(c) if criteria != "" { schiavo.CMs.Send( @@ -126,6 +132,7 @@ func registerSubmit(c *gin.Context) { setYCookie(int(lid), c) logIP(c, int(lid)) + db.Exec("UPDATE beta_keys SET allowed = 0 WHERE key_md5 = ?", cmd5(c.PostForm("key")) rd.Incr("ripple:registered_users") diff --git a/templates/register/register.html b/templates/register/register.html index 63d7f34..4d57e42 100644 --- a/templates/register/register.html +++ b/templates/register/register.html @@ -31,6 +31,10 @@ +
+ + +
{{ with config "RecaptchaSite" }}