initial prototype based on nat-as-server
Some checks failed
PHPUnit / test (push) Has been cancelled
Some checks failed
PHPUnit / test (push) Has been cancelled
This commit is contained in:
21
handlers/activity_log.php
Normal file
21
handlers/activity_log.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Admin: read API activity log (app sync + data changes only).
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../lib/api_log.php';
|
||||
|
||||
$tokenRec = require_valid_token_web();
|
||||
require_role(['admin'], $tokenRec);
|
||||
|
||||
if ($method !== 'GET') {
|
||||
json_error('METHOD_NOT_ALLOWED', 'Method not allowed', 405);
|
||||
}
|
||||
|
||||
$date = trim((string)($_GET['date'] ?? date('Y-m-d')));
|
||||
$activity = trim((string)($_GET['activity'] ?? ''));
|
||||
$limit = (int)($_GET['limit'] ?? 200);
|
||||
$errorsOnly = !empty($_GET['errorsOnly']) || $activity === 'errors';
|
||||
|
||||
json_success(qdb_api_log_read_entries($date, $activity, $limit, $errorsOnly));
|
||||
Reference in New Issue
Block a user