Fix _branding.php session lookup using correct column name (id not token)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 22:04:13 +00:00
parent 978ea6082c
commit 89996cc0ea
+1 -1
View File
@@ -17,7 +17,7 @@ function novacpx_get_branding(): array {
$token = $_COOKIE['ncpx_session'] ?? ''; $token = $_COOKIE['ncpx_session'] ?? '';
if (!$token || strlen($token) < 32) return $cache = []; if (!$token || strlen($token) < 32) return $cache = [];
$stmt = $pdo->prepare("SELECT user_id FROM sessions WHERE token = ? AND expires_at > datetime('now') LIMIT 1"); $stmt = $pdo->prepare("SELECT user_id FROM sessions WHERE id = ? AND expires_at > datetime('now') LIMIT 1");
$stmt->execute([substr($token, 0, 128)]); $stmt->execute([substr($token, 0, 128)]);
$uid = (int)($stmt->fetchColumn() ?: 0); $uid = (int)($stmt->fetchColumn() ?: 0);
if (!$uid) return $cache = []; if (!$uid) return $cache = [];