21 lines
555 B
PHP
21 lines
555 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
require_once __DIR__ . '/../app/channel_data.php';
|
|
|
|
function audit_respond(int $status, array $payload): void
|
|
{
|
|
http_response_code($status);
|
|
echo json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
exit;
|
|
}
|
|
|
|
try {
|
|
channel_app_bootstrap();
|
|
audit_respond(200, ['success' => true, 'data' => audit_log_list($_GET)]);
|
|
} catch (Throwable $e) {
|
|
audit_respond(500, ['success' => false, 'error' => 'Unable to load audit log.']);
|
|
}
|