Files
chat/api/stats.php
T
2026-06-08 15:44:15 -04:00

11 lines
354 B
PHP

<?php
define('CYBERCHAT_API', true);
require_once __DIR__ . '/../bootstrap.php';
sendCorsHeaders();
$user = authUser(false);
$type = preg_replace('/[^a-z0-9_.-]/i', '', (string)($_POST['event'] ?? 'visit')) ?: 'visit';
$path = (string)($_POST['path'] ?? '');
trackEvent($type, $path, $user ? (int)$user['id'] : null);
jsonResponse(['success' => true]);