Files
reflector-dashboard/auth/user_events.php
T

28 lines
800 B
PHP

<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
$uuid = require_login();
$r = redis();
$events = $r->lRange(rkey("user_events:$uuid"), 0, 49);
$list = [];
if (is_array($events)) {
foreach ($events as $e) {
$d = json_decode($e, true);
if (is_array($d)) $list[] = $d;
}
}
json_out(['ok' => true, 'events' => $list]);