This commit is contained in:
Alicia 2019-02-23 16:21:16 +00:00
parent 4c33ed64aa
commit ce53ca26a8
2 changed files with 11 additions and 0 deletions

View File

@ -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")

View File

@ -31,6 +31,10 @@
<label>{{ .T "Email" }}</label>
<input tabindex="3" type="email" name="email" placeholder="{{ .T "Email" }}" value="{{ .FormData.email }}" required>
</div>
<div class="field">
<label>{{ .T "Registration Key" }}</label>
<input tabindex="3" type="text" name="key" placeholder="{{ .T "Key" }}" value="{{ .FormData.key }}" required>
</div>
{{ with config "RecaptchaSite" }}
<div class="field">
<div class="g-recaptcha" data-sitekey="{{ . }}"></div>