feat(security): 新增网站安全扩展模块并支持修改手机脱敏验证

This commit is contained in:
kate522 committed 2026-10-06 09:26:55 +08:00
1 parent 224f86ec08
commit af72364078
30 files changed
+1389 -73

No files matched your search

+12
View File
@@ -121,6 +121,18 @@ trait FrontSubmitSave {
$author_id = (int) $settings['default_user_id'];
}
// [防刷机制]发布限制(后台「扩展&增强 → 网站安全」),管理员不受限。
if (!$is_edit && !current_user_can('manage_options') && class_exists('\AKSRT\Extensions\SecurityHardening')) {
$security = \AKSRT\Settings\ExtensionRuntime::get_security_settings();
$brush_subject = $is_guest
? (string) (function_exists('aksrt_get_client_ip') ? aksrt_get_client_ip() : ($_SERVER['REMOTE_ADDR'] ?? ''))
: (string) $user_id;
$brush = \AKSRT\Extensions\SecurityHardening::brush_allow('post', $brush_subject, (int) $security['security_brush_post_10min'], (int) $security['security_brush_post_day']);
if ($brush !== true) {
return ['success' => false, 'message' => (string) $brush];
}
}
$status = 'draft';
if (!$is_draft) {
$status = $this->resolve_publish_status($user_id);