getMessage(), FILE_APPEND); exit(); } # check for short link ?>getMessage(), FILE_APPEND); } # start tracking if(count($data)) { if($data['process-id'] > 0 || $data['offer-id'] > 0) { try { if ($data['list-id'] !== 0 && $data['act'] !== "bt") { if (is_bot()) { $output = $data['list-id'] . "_" . $data['client-id'] . ",". $data['process-id'] ."," . getIPAddress() . "," . date('Y-m-d H:i:s') . "," . $data['act'] . ",\"" . $_SERVER['HTTP_USER_AGENT'] . "\""; file_put_contents("bots.csv", $output . "\n", FILE_APPEND); header("location: https://www.google.com"); exit(); } } } catch (\Throwable $th) { // file_put_contents("error.txt", "[" . date('Y-m-d H:i:s') . '] ' . $th->getMessage() . "\n", FILE_APPEND); } $api = decrypt('xc6burix6o14p4FgR+uGRHbZYnSojLWvKfq62N8It8+MPF/zo30lUdfWCuRK/AEGugyEp2GKmryupo5lN1RkOlybwRAh7AUuJCZzN0TSRS8='); $data['ip'] = getIp(); $data['agent'] = (filter_input(INPUT_SERVER,'HTTP_USER_AGENT') != null) ? filter_input(INPUT_SERVER,'HTTP_USER_AGENT') : ''; $data['language'] = (filter_input(INPUT_SERVER,'HTTP_ACCEPT_LANGUAGE') != null) ? strtoupper(substr(filter_input(INPUT_SERVER,'HTTP_ACCEPT_LANGUAGE'), 0, 2)) : ''; if($data['act'] == 'oop') { $message = ""; if(count($_POST)) { $email = (filter_input(INPUT_POST,'email') != null) ? filter_input(INPUT_POST,'email') : ''; # send tracking information to bluemail if(!filter_var($email,FILTER_VALIDATE_EMAIL)) { $message = "Please check your email !"; } else { # check if email is the same $result = json_decode(sendPostRequest($api,["controller" =>"Tracking","action" =>"checkEmail", "parameters" => [ "email" => md5($email), "list-id" => $data['list-id'], "client-id" => $data['client-id'] ] ]),true); if(count($result) == 0 || (key_exists('status', $result) && $result['status'] != 200)) { $message = "Your Email is not registered !"; } if(strtolower(trim($result['message'])) == 'email is correct !') { # execute tracking job exec('nohup php -r \'require_once "/var/www/scripts/help.php"; $result = json_decode(sendPostRequest("' . $api . '",["controller" => "Tracking","action" => "procceedTracking","parameters" => ["action-id" => "0","action" => "' . $data["act"] . '","process-id" => "' . $data["process-id"] . '","process-type" => "' . $data["process-type"] . '","user-id" => "' . $data['user-id'] . '","vmta-id" => "' . $data["vmta-id"] . '","offer-id" => "' . $data['offer-id'] . '","list-id" => "' . $data["list-id"] . '","client-id" => "' . $data["client-id"] . '","agent" => "' . $data["agent"] . '","ip" => "' . $data["ip"] . '","language" => "' . $data["language"] . '"]]),true); print_r($result["message"] . PHP_EOL); \' 2>&1 &'); $message = "Sorry to see you leaving :("; } else { $message = "Your Email is not registered !"; } } } include_once BASE_PATH . DS . 'optout.php'; } else { # generating link and redirecting $link = ''; $actionId = 0; if(in_array($data['act'],['cl','un'])) { # get offer link $type = $data['act'] == 'cl' ? 'preview' : 'unsub'; $result = json_decode(sendPostRequest($api,[ 'controller' => 'Tracking', 'action' => 'getLink', 'parameters' => [ 'type' => $type, 'process-id' => $data['process-id'], 'process-type' => $data['process-type'], 'user-id' => $data['user-id'], 'vmta-id' => $data['vmta-id'], 'list-id' => $data['list-id'], 'client-id' => $data['client-id'], 'offer-id' => $data['offer-id'], 'ip' => $data['ip'] ] ]),true); if($result === FALSE || count($result) == 0) { die('
405 : Bad request !'); } if($result['status'] != 200) { die('
' . $result['status'] . ' : ' . $result['message'] . ''); } if(key_exists('data', $result) && key_exists('link',$result['data']) && trim($result['data']['link']) != '') { $link = trim($result['data']['link']); $actionId = intval($result['data']['action_id']); } else { echo '
Incorrect redirection !'; } } # send tracking information to master app if(in_array($data['act'],['op','cl','un']) && $data['process-id'] > 0) { # execute tracking job exec('nohup php -r \'require_once "/var/www/scripts/help.php"; $result = json_decode(sendPostRequest("' . $api . '",["controller" => "Tracking","action" => "procceedTracking","parameters" => ["action-id" => "' . $actionId . '","action" => "' . $data["act"] . '","process-id" => "' . $data["process-id"] . '","process-type" => "' . $data["process-type"] . '","user-id" => "' . $data['user-id'] . '","vmta-id" => "' . $data["vmta-id"] . '","offer-id" => "' . $data['offer-id'] . '","list-id" => "' . $data["list-id"] . '","client-id" => "' . $data["client-id"] . '","agent" => "' . $data["agent"] . '","ip" => "' . $data["ip"] . '","language" => "' . $data["language"] . '"]]),true); print_r($result["message"] . PHP_EOL); \' 2>&1 &'); } # redirecting in case of a click or unsub if($link != '') { header('Location: ' . $link); exit(); } else { echo '
Operation completed !'; } } } else { echo '
No drop found !'; } } else { echo '
No parameters found !'; }