require("/home/xtreamcodes/iptv_xtream_codes/Protocol/init.php"); require_once "recaptchalib.php"; $captchavis = "OUI"; ///////////////////////////////////////////////////////////////////////////////////////////// function validationcaptch(){ $secret = "6LeclcwUAAAAALLldvN5kEc-0K3L_ZPUenCdzdk_"; $response = null; $reCaptcha = new ReCaptcha($secret); $reqcaptcha = $_POST["g-recaptcha-response"]; if ($_POST["g-recaptcha-response"]) { $response = $reCaptcha->verifyResponse( $_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"] ); } if ($response != null && $response->success) { $statucaptchaf = 'captchaok'; }else{ $statucaptchaf = 'captchanok'; } return $statucaptchaf; } // $captchavis //////////////////////////////////////////////////////////////////////////////////////////////////// if(isset($_POST['submitcheck'])){ $statucapcha = validationcaptch(); if($statucapcha == 'captchaok'){ $mac = $_POST['tvmac']; if ( preg_match ('/([0-9A-F]{2}:){5}[0-9A-F]{2}$/i', $mac)){ $ipTV_db->query("SELECT * FROM `mac_smart_tv` WHERE `mac` = '%s' LIMIT 1", $mac); if( 0 < $ipTV_db->num_rows() ) { /// adresse MAC exite dans la base suive le traitement update infos server $user_info = $ipTV_db->get_row(); if ($user_info['pin'] == $_POST['pincode']){ $portalm3u = "1"; $link = $_POST['m3u']; $explode = explode("/get.php?", $link); $host = $explode[0]; $expldeup = explode("&", $explode[1]); $explodefin = explode("=", $expldeup[0]."=".$expldeup[1]); $username = $explodefin[1]; $password = $explodefin[3]; //$ipTV_db->query('UPDATE `mac_smart_tv` SET `host` = \'%s\',`username` = \'%s\',`password` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); switch ($portalm3u) { case 1: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host` = \'%s\',`username` = \'%s\',`password` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; case 2: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host2` = \'%s\',`username2` = \'%s\',`password2` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; case 3: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host3` = \'%s\',`username3` = \'%s\',`password3` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; case 3: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host4` = \'%s\',`username4` = \'%s\',`password4` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; } $colors = "green"; $messagereturnes = "Server Data Is Updated... !"; //$justupdate = "Server Data Is Updated."; }else { $colors = "red"; $messagereturnes = "Check Your Pin Code & Try Again !"; } }else { // adresse mac n'exsite pas donc un new adresse MAC /* /// remplisemnt donnée pour une premiere fois $jouradd = date('d-m-Y H:i:s'); $dateobj = new DateTime($jouradd); $dateobj->add(new DateInterval('P9D')); // P1D veut dire 1 Jour, P2D veut dire 2 jours ... $finDatetest = $dateobj->format('d-m-Y H:i:s'); // ensuite ici on le formate au format voulu //echo $finDatetest; // Affichage du resutlat $linkad = $_POST['m3u']; $explodead = explode("/get.php?", $linkad); $host = $explodead[0]; $expldeupad = explode("&", $explodead[1]); $explodefinad = explode("=", $expldeupad[0]."=".$expldeupad[1]); $login = $explodefinad[1]; $pass = $explodefinad[3]; $pin = $_POST['pincode']; $macadress = $_POST['tvmac']; //$host = $_POST['protocol'].$_POST['host'].":".$_POST['port']; //$login = $_POST['username']; //$pass = $_POST['password']; $datedajout = strtotime($jouradd); $datedafin = strtotime($finDatetest); $trial = 1; $remainingDays = 7; $status = 3; $countryCode = 'NA'; $ipTV_db->query('INSERT INTO `mac_smart_tv` (`pin`,`mac`,`host`,`username`,`password`,`exp_date`,`created_at`,`trial`,`remainingDays`,`status`,`countryCode`) VALUES(\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%s\')', $pin, $macadress, $host, $login, $pass, $datedajout, $datedafin, $trial, $remainingDays, $status, $countryCode); $colors = "green"; $messagereturnes = "Succes : Mac Address ".$_POST['tvmac']." Activated"; // For 3 Days."; */ } }else{ $colors = "red"; $messagereturnes = "Error : Invalid Mac Address.!!!"; } }else{ // captcha nok $colors = "red"; $messagereturnes = "Captcha: Validation Error: Value is required."; } } ////////// ///////////////////////////////////////// remplissage user /////////////////////: if(isset($_POST['submitcheckuser'])){ $statucapcha = validationcaptch(); if($statucapcha == 'captchaok'){ $mac = $_POST['macuser']; //$macsanslesdeuxpoints = ctype_xdigit(str_replace(':','',$mac)); if ( preg_match('/([0-9A-F]{2}:){5}[0-9A-F]{2}$/i', $mac) ){ $ipTV_db->query("SELECT * FROM `mac_smart_tv` WHERE `mac` = '%s' LIMIT 1", $mac); if( 0 < $ipTV_db->num_rows() ) { /// adresse MAC exite dans la base suive le traitement update infos server $user_info = $ipTV_db->get_row(); if ($user_info['pin'] == $_POST['pinuser']){ $portal = "1"; $hostnames = $_POST['hostname']; //$port = $_POST['port']; $host = $hostnames; $username = $_POST['username']; $password = $_POST['password']; $ipTV_db->query('UPDATE `mac_smart_tv` SET `host` = \'%s\',`username` = \'%s\',`password` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); switch ($portal) { case 1: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host` = \'%s\',`username` = \'%s\',`password` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; case 2: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host2` = \'%s\',`username2` = \'%s\',`password2` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; case 3: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host3` = \'%s\',`username3` = \'%s\',`password3` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; case 3: $ipTV_db->query('UPDATE `mac_smart_tv` SET `host4` = \'%s\',`username4` = \'%s\',`password4` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); break; } $colors = "green"; $messagereturnes = "Server Data Is Updated... !"; //$justupdate = "Server Data Is Updated."; }else { $colors = "red"; $messagereturnes = "Check Your Pin Code & Try Again !"; } }else { // adresse mac n'exsite pas donc un new adresse MAC /* /// remplisemnt donnée pour une premiere fois $jouradd = date('d-m-Y H:i:s'); $dateobj = new DateTime($jouradd); $dateobj->add(new DateInterval('P9D')); // P1D veut dire 1 Jour, P2D veut dire 2 jours ... $finDatetest = $dateobj->format('d-m-Y H:i:s'); // ensuite ici on le formate au format voulu echo $finDatetest; // Affichage du resutlat $pin = $_POST['pincode']; $macadress = $_POST['tvmac']; $host = $_POST['protocol'].$_POST['hostname'].":".$_POST['port']; $login = $_POST['username']; $pass = $_POST['password']; $datedajout = strtotime($jouradd); $datedafin = strtotime($finDatetest); $trial = 1; $remainingDays = 7; $status = 3; $countryCode = 'NA'; $ipTV_db->query('INSERT INTO `mac_smart_tv` (`pin`,`mac`,`host`,`username`,`password`,`exp_date`,`created_at`,`trial`,`remainingDays`,`status`,`countryCode`) VALUES(\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%s\')', $pin, $macadress, $host, $login, $pass, $datedafin, $datedajout, $trial, $remainingDays, $status, $countryCode); $colors = "green"; $messagereturnes = "Succes : Mac Address ".$_POST['tvmac']." Activated"; // For 3 Days."; */ } }else{ $colors = "red"; $messagereturnes = "Error : Invalid Mac Address.!!!"; } }else{ // captcha nok jawadsat@gmail.com $colors = "red"; $messagereturnes = "Captcha: Validation Error: Value is required."; } } //////////////////////////////////////////////////////////////////////////////////////////////// ?>