Browse Source

注册时加同意相关协议限制

tags/v1.22.7.1
chenshihai 3 years ago
parent
commit
e19b70fc71
4 changed files with 9 additions and 1 deletions
  1. +1
    -0
      modules/auth/user_form.go
  2. +1
    -0
      options/locale/locale_en-US.ini
  3. +2
    -1
      options/locale/locale_zh-CN.ini
  4. +5
    -0
      routers/user/auth.go

+ 1
- 0
modules/auth/user_form.go View File

@@ -85,6 +85,7 @@ type RegisterForm struct {
VerifyCode string `binding:"MaxSize(10)"`
Retype string
GRecaptchaResponse string `form:"g-recaptcha-response"`
Agree bool
}

// Validate valideates the fields


+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -33,6 +33,7 @@ twofa = Two-Factor Authentication
twofa_scratch = Two-Factor Scratch Code
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>
sign_up_agree_tips = should agree to the use agreement and privacy agreement!

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.


+ 2
- 1
options/locale/locale_zh-CN.ini View File

@@ -32,7 +32,8 @@ captcha=验证码
twofa=两步验证
twofa_scratch=两步验证口令
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_sign_in=按下安全密钥上的按钮。如果安全密钥没有按钮,请重新插入。


+ 5
- 0
routers/user/auth.go View File

@@ -1315,6 +1315,11 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
return
}
}
if !form.Agree {
ctx.RenderWithErr(ctx.Tr("sign_up_agree_tips"), tplSignUp, &form)
return
}

u := &models.User{
Name: form.UserName,


Loading…
Cancel
Save