Files
reflector-dashboard/auth/consent.php
T
bjorne cb8b9af20e sync från dev (svx-web): lastheard paginering + separat live-feed, listen-vy, UI-uppdateringar
- lastheard 24h: client-side paginering (lib/pager.js), dynamisk sidstorlek
- lastheard: separat live-feed (lastheard_live_view.js), 24h loggar varje key-up
- listen_view.js + auth/admin_listen.*: Listen Live
- genomgående UI/auth-uppdateringar synkade från dev
Inga hårdkodade secrets/IP/login — endast hostnamn.
2026-11-18 22:07:16 +01:00

21 lines
514 B
PHP

<?php
declare(strict_types=1);
require __DIR__ . '/lib.php';
$j = json_in();
$consent = (string)($j['consent'] ?? '');
if ($consent !== 'necessary' && $consent !== 'all') {
json_out(['ok'=>false,'error'=>'bad_consent'], 400);
}
$maxAge = 60 * 60 * 24 * 365;
setcookie('cookie_consent', $consent, [
'expires' => time() + $maxAge,
'path' => '/',
'secure' => (bool)(cfg()['session']['cookie_secure'] ?? false),
'httponly' => false,
'samesite' => 'Lax',
]);
json_out(['ok'=>true, 'consent'=>$consent]);