mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
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:
@@ -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 = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user