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 @@ +