refactor(permissions): remove hard-off compat stubs and harden login schema

Delete aksrt-compat.php and rewire messages/PM entry points to the user
center notification route. Normalize permissions login dependsOn objects
and allow an explicit empty captcha provider option so login/moderation
schema pages remain loadable without legacy compatibility shims.
This commit is contained in:
kate522 committed 2026-07-11 15:29:20 +08:00
1 parent f86513dbff
commit 06e551e6d8
6 files changed
+14 -53

No files matched your search

-1
View File
@@ -36,7 +36,6 @@ require_once AKSRT_DIR . '/inc/helpers/aksrt-vip.php';
require_once AKSRT_DIR . '/inc/helpers/aksrt-i18n-switch.php';
require_once AKSRT_DIR . '/inc/helpers/aksrt-posts-renderer.php';
require_once AKSRT_DIR . '/inc/helpers/aksrt-resource.php';
require_once AKSRT_DIR . '/inc/helpers/aksrt-compat.php';
require_once AKSRT_DIR . '/inc/helpers/aksrt-pay.php';
require_once AKSRT_DIR . '/inc/helpers/aksrt-credits.php';
require_once AKSRT_DIR . '/inc/helpers/menu-decoration.php';
@@ -23,6 +23,7 @@ class AKSRT_Admin_Schema_Permissions {
['key' => 'basic', 'title' => '基础开关', 'fields' => [
['key' => 'enabled', 'label' => '启用人机验证', 'type' => 'switch', 'default' => false],
['key' => 'active_provider', 'label' => '当前服务商', 'type' => 'radio', 'default' => '', 'dependsOn' => ['key' => 'enabled', 'value' => true], 'options' => [
['label' => '关闭', 'value' => ''],
['label' => '腾讯云 Captcha', 'value' => 'tencent'],
['label' => '阿里云 CAPTCHA 2.0', 'value' => 'aliyun'],
['label' => 'Cloudflare Turnstile', 'value' => 'cloudflare'],
-40
View File
@@ -1,40 +0,0 @@
<?php
/**
* Deprecated compatibility toggles retained only as hard-off stubs.
*
* The rebuild now treats Zibll-style mainline pages as the only product target.
* Historical message center / PM entry points / compat template pickers stay on
* disk for legacy routing safety, but no longer participate in product-facing
* navigation or configuration decisions.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_messages_url')) {
/**
* Legacy message center URL stub.
*/
function aksrt_get_messages_url(): string {
return home_url('/messages/');
}
}
if (!function_exists('aksrt_pm_frontend_enabled')) {
/**
* Private-message entry is disabled in the rebuilt mainline.
*/
function aksrt_pm_frontend_enabled(): bool {
return false;
}
}
if (!function_exists('aksrt_show_compat_page_templates')) {
/**
* Compat-only page templates are hidden from the rebuilt product surface.
*/
function aksrt_show_compat_page_templates(): bool {
return false;
}
}
+1 -1
View File
@@ -453,7 +453,7 @@ if (!function_exists('aksrt_get_user_center_render_context')) {
'show_avatar_edit' => !empty($user_center_settings['avatar_upload']),
'avatar_settings_url' => admin_url('profile.php'),
'notification_unread_count' => function_exists('aksrt_get_user_unread_notification_count') ? aksrt_get_user_unread_notification_count($user_id) : 0,
'messages_url' => function_exists('aksrt_get_messages_url') ? aksrt_get_messages_url() : aksrt_get_user_center_url('notif'),
'messages_url' => aksrt_get_user_center_url('notif'),
'per_page' => 10,
'posts_page' => max(1, isset($_GET['posts_page']) ? (int) $_GET['posts_page'] : 1),
'comments_page' => max(1, isset($_GET['comments_page']) ? (int) $_GET['comments_page'] : 1),