yyxx
This commit is contained in:
@@ -121,6 +121,31 @@ if (preg_match('~^api/module-auth/([a-zA-Z0-9_-]+)$~', $uriPath, $moduleAuthMatc
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($uriPath === 'api/debug/entries') {
|
||||
require_admin();
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode([
|
||||
'data' => [
|
||||
'enabled' => nexus_debug_enabled(),
|
||||
'entries' => nexus_debug_entries(),
|
||||
],
|
||||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($uriPath === 'api/debug/clear' && strtoupper((string) ($_SERVER['REQUEST_METHOD'] ?? 'GET')) === 'POST') {
|
||||
require_admin();
|
||||
nexus_debug_clear();
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode([
|
||||
'data' => [
|
||||
'cleared' => true,
|
||||
'entries' => [],
|
||||
],
|
||||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (preg_match('~^api/mining-checker(?:/(.*))?$~', $uriPath, $apiMatches)) {
|
||||
$moduleMeta = app()->modules()->get('mining-checker') ?? ['auth' => ['required' => false]];
|
||||
if (!$auth->canAccessModule($moduleMeta)) {
|
||||
|
||||
Reference in New Issue
Block a user