Files
reflector-dashboard/auth/me.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

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);