LuminaWebsite/tour_action.php
Maaxxs f773169a7e Dashboard onboarding tour for new members, restartable from the profile
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 18:46:21 +02:00

19 lines
611 B
PHP

<?php
require_once __DIR__ . '/includes/bootstrap.php';
// Einfuehrung im Dashboard als erledigt merken (abgeschlossen oder uebersprungen).
// Aufgerufen per fetch() aus assets/js/tour.js.
require_login();
header('Content-Type: application/json; charset=UTF-8');
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
echo json_encode(['ok' => false]);
exit;
}
$body = read_json_body();
verify_csrf_token($body['csrf_token'] ?? '');
db()->prepare('UPDATE users SET tour_completed_at = NOW() WHERE id = ?')->execute([(int) current_user()['id']]);
echo json_encode(['ok' => true]);