19 lines
611 B
PHP
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]);
|