You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/web/docs/captcha-configuration.md

19 lines
1.8 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 验证码设置迁移
管理员后台的「配置文件 → 验证码设置」管理以下六项。登录、注册和密码找回流程都从 `configurations` 数据表读取,不读取 `config/.config.php` 中同名参数。付费注册已删除。
| 配置项 | 无数据库记录时的默认值 | 作用 |
| --- | --- | --- |
| `captch_reg` | `false` | 注册图形验证码 |
| `captch_login` | `false` | 登录图形验证码 |
| `captch_respass` | `true` | 重置密码图形验证码 |
| `enable_email_verify` | `true` | 注册邮箱验证码 |
| `email_verify_ttl` | `900` | 新发邮箱验证码的有效期,1–86400 秒 |
| `email_verify_iplimit` | `5` | 同 IP 尚未过期的邮箱验证码记录上限,1–10000 次;注册和登录安全验证共用 |
旧版 `config/.config.php` 可能包含自定义值,但该文件不在仓库中。**部署前必须核对现网六项实际值**:若无数据库记录,新版本立即使用上表默认值,可能把原本开启的注册或登录图形验证码关闭。建议在维护窗口暂停注册,先把六项实际值写入主库 `configurations` 的同名 `name`/`value` 记录(已存在则更新,不要重复插入),再发布代码;发布后在后台确认显示与旧值一致,然后恢复注册。上线后可从实际 `config/.config.php` 删除这六项;仓库中的 `config/.config.php.example` 已移除默认参数。
修改有效期不会延长或缩短已经发送的验证码,因为每条验证码在发送时写入独立的到期时间。后台保存后的下一次 PHP 请求会读取新配置。
数据库查询失败时不会退回可能关闭验证码的默认值,相关请求会报错;已有数据库记录若包含非法开关值,则按开启处理。非法有效期或次数会退回上表的安全数值。