| @@ -85,6 +85,7 @@ type RegisterForm struct { | |||||
| VerifyCode string `binding:"MaxSize(10)"` | VerifyCode string `binding:"MaxSize(10)"` | ||||
| Retype string | Retype string | ||||
| GRecaptchaResponse string `form:"g-recaptcha-response"` | GRecaptchaResponse string `form:"g-recaptcha-response"` | ||||
| Agree bool | |||||
| } | } | ||||
| // Validate valideates the fields | // Validate valideates the fields | ||||
| @@ -33,6 +33,7 @@ twofa = Two-Factor Authentication | |||||
| twofa_scratch = Two-Factor Scratch Code | twofa_scratch = Two-Factor Scratch Code | ||||
| passcode = Passcode | passcode = Passcode | ||||
| use_and_privacy_agree = I have read and agree to the <a target="_blank" href="%s">use agreement</a> and <a target="_blank" href="%s">privacy agreement</a> | use_and_privacy_agree = I have read and agree to the <a target="_blank" href="%s">use agreement</a> and <a target="_blank" href="%s">privacy agreement</a> | ||||
| sign_up_agree_tips = should agree to the use agreement and privacy agreement! | |||||
| u2f_insert_key = Insert your security key | u2f_insert_key = Insert your security key | ||||
| u2f_sign_in = Press the button on your security key. If your security key has no button, re-insert it. | u2f_sign_in = Press the button on your security key. If your security key has no button, re-insert it. | ||||
| @@ -32,7 +32,8 @@ captcha=验证码 | |||||
| twofa=两步验证 | twofa=两步验证 | ||||
| twofa_scratch=两步验证口令 | twofa_scratch=两步验证口令 | ||||
| passcode=验证码 | passcode=验证码 | ||||
| use_and_privacy_agree = 我已阅读并同意<a target="_blank" href="%s">使用协议</a>和<a target="_blank" href="%s">隐私协议</a> | |||||
| use_and_privacy_agree = 我已阅读并同意 <a target="_blank" href="%s">使用协议</a> 和 <a target="_blank" href="%s">隐私协议</a> | |||||
| sign_up_agree_tips = 注册时需同意使用协议和隐私协议 | |||||
| u2f_insert_key=插入安全密钥 | u2f_insert_key=插入安全密钥 | ||||
| u2f_sign_in=按下安全密钥上的按钮。如果安全密钥没有按钮,请重新插入。 | u2f_sign_in=按下安全密钥上的按钮。如果安全密钥没有按钮,请重新插入。 | ||||
| @@ -1315,6 +1315,11 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo | |||||
| return | return | ||||
| } | } | ||||
| } | } | ||||
| if !form.Agree { | |||||
| ctx.RenderWithErr(ctx.Tr("sign_up_agree_tips"), tplSignUp, &form) | |||||
| return | |||||
| } | |||||
| u := &models.User{ | u := &models.User{ | ||||
| Name: form.UserName, | Name: form.UserName, | ||||