= LOGIN_TITLE; ?>
= LOGIN_TEXT; ?>
if ($_POST["login"]) {
$username = $byakman->guvenlik($_POST["username"]);
$sifre = $byakman->guvenlik($_POST["sifre"]);
$mac = $byakman->guvenlik($_POST["mac"]);
$beni_hatirla = $byakman->guvenlik($_POST["beni_hatirla"]);
$recaptcha_secret = $siteInfo->recaptcha_secret;
$recaptcha_response = $_POST['recaptcha_response'];
if (empty($username) || empty($sifre)) {
if (empty($mac)) {
echo '
'.LOGIN_ALERT_7.'
';
} else {
if ($siteInfo->recaptcha == 1) {
// call curl to POST request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.google.com/recaptcha/api/siteverify");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('secret' => $recaptcha_secret, 'response' => $recaptcha_response)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$arrResponse = json_decode($response, true);
if ($arrResponse["score"] >= 0.5) {
$post_data = array( 'mac' => strtoupper($mac) );
$api_result = json_decode($byakman->_curl($siteInfo->site_xtream . "api.php?action=stb&sub=info", $post_data), true);
if ($api_result["error"] != "NOT EXISTS") {
if($api_result["result"] == "1"){
if ($siteInfo->unlimited_login == 0 AND $api_result["user_info"]["exp_date"] == null) {
echo '
'.LOGIN_ALERT_8.'
';
} else {
$_SESSION['login'] = true;
$_SESSION['user_info'] = $api_result['user_info'];
$_SESSION['mac_address'] = $mac;
if ($remember == 1) {
setcookie('username',$api_result['user_info']['username'], time()+ 31536000);
setcookie('password',$api_result['user_info']['password'], time()+ 31536000);
setcookie('mac', $api_result['mag_device']['mac']);
}
echo '
'.LOGIN_ALERT_3.'
';
header("Refresh: 2; URL=index.php?page=homepage");
}
} else {
echo '
'.LOGIN_ALERT_5.'
';
}
} else {
echo '
'.LOGIN_ALERT_6.'
';
}
} else {
echo '
'.LOGIN_ALERT_4.'
';
}
} else {
$post_data = array( 'mac' => strtoupper($mac) );
$api_result = json_decode($byakman->_curl($siteInfo->site_xtream . "api.php?action=stb&sub=info", $post_data), true);
if ($api_result["error"] != "NOT EXISTS") {
if($api_result["result"] == "1"){
if ($siteInfo->unlimited_login == 0 AND $api_result["user_info"]["exp_date"] == null) {
echo '
'.LOGIN_ALERT_8.'
';
} else {
$_SESSION['login'] = true;
$_SESSION['user_info'] = $api_result['user_info'];
$_SESSION['mac_address'] = $mac;
if ($remember == 1) {
setcookie('username',$api_result['user_info']['username'], time()+ 31536000);
setcookie('password',$api_result['user_info']['password'], time()+ 31536000);
setcookie('mac', $api_result['mag_device']['mac']);
}
echo '
'.LOGIN_ALERT_3.'
';
header("Refresh: 2; URL=index.php?page=homepage");
}
} else {
echo '
'.LOGIN_ALERT_5.'
';
}
} else {
echo '
'.LOGIN_ALERT_6.'
';
}
}
}
} else {
if ($username == "") {
echo '
'.LOGIN_ALERT_1.'
';
} else if ($sifre == "") {
echo '
'.LOGIN_ALERT_2.'
';
} else {
if ($siteInfo->recaptcha == 1) {
// call curl to POST request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.google.com/recaptcha/api/siteverify");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('secret' => $recaptcha_secret, 'response' => $recaptcha_response)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$arrResponse = json_decode($response, true);
if ($arrResponse["score"] >= 0.5) {
$post_data = array( 'username' => $username, 'password' => $sifre );
$api_result = json_decode($byakman->get_curl($siteInfo->site_xtream . "player_api.php?username=".$username."&password=".$sifre.""), true);
if ($api_result["user_info"]["status"] === 'Active') {
if ($siteInfo->unlimited_login == 0 AND $api_result["user_info"]["exp_date"] == null) {
echo '
'.LOGIN_ALERT_8.'
';
} else {
$_SESSION["login"] = true;
$_SESSION["user_info"] = $api_result["user_info"];
if ($remember == 1) {
setcookie('username',$username, time()+ 31536000);
setcookie('password',$password, time()+ 31536000);
}
echo '
'.LOGIN_ALERT_3.'
';
header("Refresh: 2; URL=index.php?page=homepage");
}
} else {
echo '
'.LOGIN_ALERT_6.'
';
}
} else {
echo '
'.LOGIN_ALERT_4.'
';
}
} else {
$post_data = array( 'username' => $username, 'password' => $sifre );
$api_result = json_decode($byakman->get_curl($siteInfo->site_xtream . "player_api.php?username=".$username."&password=".$sifre.""),true);
if ($api_result["user_info"]["status"] === 'Active') {
if ($siteInfo->unlimited_login == 0 AND $api_result["user_info"]["exp_date"] == null) {
echo '
'.LOGIN_ALERT_8.'
';
} else {
$_SESSION["login"] = true;
$_SESSION["user_info"] = $api_result["user_info"];
if ($remember == 1) {
setcookie('username',$username, time()+ 31536000);
setcookie('password',$password, time()+ 31536000);
}
echo '
'.LOGIN_ALERT_3.'
';
header("Refresh: 2; URL=index.php?page=homepage");
}
} else {
echo '
'.LOGIN_ALERT_6.'
';
}
}
}
}
// Login Mac
}
?>