<?php  if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } function renderFingerprintHistory(int $userId): string { $devices = Database::fetchAll( "SELECT id, device_token, ip_address, user_agent, last_seen, created_at FROM device_bindings WHERE user_id=:uid ORDER BY last_seen DESC LIMIT 20", [":uid"=>$userId] ); $html = "<div class=\"fingerprint-history\"><h3>Device History</h3>"; foreach ($devices as $d) { $html .= "<div class=\"device-entry\">"; $html .= "<span>" . UI::e(substr($d["user_agent"] ?? "", 0, 50)) . "</span>"; $html .= "<span>" . UI::e($d["ip_address"] ?? "") . "</span>"; $html .= "<span>Token: " . UI::e(substr($d["device_token"] ?? "", 0, 12)) . "...</span>"; $html .= "<span>" . UI::e($d["last_seen"] ?? "") . "</span>"; $html .= "</div>"; } $html .= "</div>"; return $html; } 