Fix platform_stats returning Forbidden — $isAdmin undefined in admin.php

requireAdmin() already guards the whole file; the extra check was
referencing an undefined variable that always evaluated false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 22:06:48 +00:00
parent d8202427ae
commit 253cd0a743
-1
View File
@@ -70,7 +70,6 @@ switch ($action) {
// ─── PLATFORM STATS ──────────────────────────────────────
case 'platform_stats':
if (!$isAdmin) { echo json_encode(['success'=>false,'error'=>'Forbidden']); exit; }
$rows = db()->query("
SELECT p.id, p.name, p.slug, p.color,
COALESCE(SUM(CASE WHEN pc.type='debit' THEN -pc.credits_purchased ELSE pc.credits_purchased END),0) AS credits_balance,