mirror of
https://github.com/myronblair/tomtomgames
synced 2026-06-30 17:51:08 -05:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user