11 lines
354 B
PHP
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]);
|