prepare("SELECT telegram_id FROM occupant WHERE id_occupant = ?"); $tstmt->execute([$id_occupant]); $tdata = $tstmt->fetch(PDO::FETCH_ASSOC); if ($tdata && $tdata['telegram_id']) { $chatId = $tdata['telegram_id']; file_get_contents("https://api.telegram.org/bot$botToken/deleteMessage?chat_id=$chatId&message_id={$tokenData['msg_id']}"); } } unset($tokens[$postToken]); file_put_contents($manifestPath, json_encode($tokens, JSON_PRETTY_PRINT)); } } echo json_encode(['status'=>'ok']); exit; } } // Validasi token via local request atau include logic langsung // Karena ini di file yang sama (local), kita bisa request HTTP ke server sendiri // Tapi untuk mudahnya karena sudah ada db: $manifestPath = __DIR__ . '/manifest_pin_tokens.json'; if (file_exists($manifestPath)) { $json = file_get_contents($manifestPath); $tokens = json_decode($json, true) ?: []; if (isset($tokens[$tokenParam])) { $tokenData = $tokens[$tokenParam]; $idParam = $tokenData['id_occupant']; $stmt = $pdo->prepare("SELECT name, foto, pin FROM occupant WHERE id_occupant = ?"); $stmt->execute([$idParam]); $row = $stmt->fetch(); if ($row && !empty($row['foto'])) { $valid = true; $fotoRef = htmlspecialchars($row['foto']); $occupantName = htmlspecialchars($row['name']); $pin = htmlspecialchars($row['pin']); } } } } if (!$valid) { header("Location: 404.php"); exit; } ?> Face Verification — Identia

Access Granted

Your face matches the occupant data for . Here is your secret PIN:

This page will automatically close in 10 seconds to keep your session secure.