From 77f88ca5bf8ef04c0093b01cff27506191ddd0e8 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Mon, 8 Jun 2026 22:39:22 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20suspend/unsuspend/terminate=20=E2=80=94?= =?UTF-8?q?=20wrong=20body=20field=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JS sends account_id but PHP was reading id; both now accept either. Same fix applied to terminate. Co-Authored-By: Claude Sonnet 4.6 --- panel/api/endpoints/accounts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panel/api/endpoints/accounts.php b/panel/api/endpoints/accounts.php index ae06383..de5b8d9 100644 --- a/panel/api/endpoints/accounts.php +++ b/panel/api/endpoints/accounts.php @@ -129,7 +129,7 @@ match ($action) { })(), 'suspend' => (function() use ($db, $body, $ownerClause) { - $id = (int)($body['id'] ?? 0); + $id = (int)($body['id'] ?? $body['account_id'] ?? 0); $acct = $db->fetchOne( "SELECT a.id, a.username, a.domain, u.email FROM accounts a JOIN users u ON u.id = a.user_id WHERE a.id = ? $ownerClause", [$id] @@ -143,7 +143,7 @@ match ($action) { })(), 'unsuspend' => (function() use ($db, $body, $ownerClause) { - $id = (int)($body['id'] ?? 0); + $id = (int)($body['id'] ?? $body['account_id'] ?? 0); AccountManager::unsuspend($id); audit('account.unsuspend', "account:$id"); Response::success(null, 'Account unsuspended'); @@ -151,7 +151,7 @@ match ($action) { 'terminate' => (function() use ($db, $body, $user) { Auth::getInstance()->require('admin'); - $id = (int)($body['id'] ?? 0); + $id = (int)($body['id'] ?? $body['account_id'] ?? 0); AccountManager::terminate($id); audit('account.terminate', "account:$id"); Response::success(null, 'Account terminated');