Files
reflector-dashboard/auth/consent.php
T
bjorneandClaude Fable 5.1 25b481e2ae Public web-only release: SvxPortal front-end + auth backend, install templates and INSTALL.md
Stripped from the internal repo: per-box deploy trees, Go services (nodelist/astmeta/proxy/svxdr),
deploy/sync scripts and all secrets. Config templates for nginx, PHP-FPM, Redis and tmpfiles
live in install/ with CHANGEME placeholders.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-26 23:07:05 +02: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]);