- 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.
25 lines
769 B
PHP
25 lines
769 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
require __DIR__ . '/lib.php';
|
|
|
|
start_session();
|
|
$uuid = $_SESSION['uid'] ?? null;
|
|
if (!is_string($uuid) || $uuid === '') {
|
|
json_out(['ok'=>false,'logged_in'=>false]);
|
|
}
|
|
$acct = acct_get($uuid);
|
|
if (!$acct) {
|
|
json_out(['ok'=>false,'logged_in'=>false]);
|
|
}
|
|
unset($acct['password_hash']);
|
|
$acct['ok'] = true;
|
|
$acct['logged_in'] = true;
|
|
$acct['uuid'] = $uuid;
|
|
$acct['flags'] = acct_flags_from($acct);
|
|
$acct['admin_level'] = acct_level_from_flags($acct['flags']);
|
|
// Fine-grained rank so the UI can tell LVL1 (read-only) from LVL2 — admin_level
|
|
// collapses both to 2. lvl1=1, lvl2=2, lvl3=3, none=0.
|
|
$acct['admin_rank'] = acct_admin_rank_from($acct['flags']);
|
|
$acct['csrf_token'] = csrf_token();
|
|
json_out($acct);
|