Файл: slando.icu/modules/index/auth.php
Строк: 200
<?php
require '../../system/config_for_game.inc.php';
require '../../system/func_for_game.inc.php';
require '../../system/start_page2.inc.php';
if (isset($_COOKIE['session']) and isset($_COOKIE['id']))
{
$id = num($_COOKIE['id']);
$session = vvod($_COOKIE['session']);
$user = mysqli_num_rows(mysqli_query($link,"SELECT * FROM `users` WHERE `id`='$id' and `session`='$session' limit 1"));
if ($sett['open_game'] == 1 and $user!=0)
{
go("/game");
}}
if(!isset($_POST['pass'])){
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head><title>Пираты</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="x-dns-prefetch-control" content="on" />
<link rel="dns-prefetch" href="http://pirats.mobi/" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ru" />
<meta name="description" content="Захватывающая онлайн игра на твой мобильный. Тебе предстоит стать пиратом, развивать его и сражаться с другими пиратами." />
<meta property="og:title" content="Пираты" />
<meta property="og:type" content="игра" />
<meta property="og:url" content="http://pirats.mobi/" />
<meta property="og:image" content="http://pirats.mobi//images/logo.png" />
<meta name="Keywords" content="Пираты, корабли, сражения, MMORPG, игры, онлайн, браузерная, мобильная, бесплатная, победа, абордаж, ролевые игры, лучшие онлайн игры, битвы, пираты онлайн, играть онлайн, RPG" />
<meta name="viewport" content="user-scalable=yes, minimum-scale=1, maximum-scale=1, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="icon" href="http://pirats.mobi/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://pirats.mobi/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="/style/main3.css"/>
</head><body>
<div class="main">
';
/** вывод ошибок **/
if(isset($_SESSION['pokaz'])){echo $_SESSION['pokaz'];unset($_SESSION['pokaz']);}
echo'
<img width="100%" src="/images/icon/logo.png" alt="" />
<div class="block1 center">';
/** вывод ошибок **/
if (isset($_GET['err'])) {$err=vvod($_GET['err']);} else {$err="";}
$err_left = '<div class="error2">';
$err_right = '</div>';
switch($err)
{
case 'c4ca4238a0b923820dcc509a6f75849b': echo $err_left.'Необходимо ввести логин!'.$err_right; break;
case 'c81e728d9d4c2f636f067f89cc14862c': echo $err_left.'Необходимо ввести пароль!'.$err_right; break;
case 'eccbc87e4b5ce2fe28308fd9f2a7baf3': echo $err_left.'Данные введены неверно!'.$err_right; break;
}
echo'<form action="/auth" method="post">
<div class="clrt1" >Логин:</div>
<div><input name="login" type="text" class="textr" /></div>
<div class="clrt1">Пароль:</div>
<div><input class="textr" name="pass" type="password" /></div>
<div><input type="submit" class="submit2" value="Вход" /></div>
</form>
<a class="ssilki3" href="/lostpass">Забыли пароль?</a>
<a class="ssilki3" href="/">Назад</a>
</div>
</div>';
echo'<div class="razriv2"></div>
<div><a class="foots" href="http://topswap.ru/">Другие игры</a></div>
<div class="center">
<a href="http://katstat.ru/in/118"><img src="http://katstat.ru/counter/small/118" alt="KatStat.ru - Топ рейтинг сайтов"></a>
<a href="https://onstata.ru/in/498.php"><img src="//onstata.ru/count/small/498.gif" alt="onstata.ru"/></a>
<a href="http://statok.net/go/18348"><img src="//statok.net/imageOther/18348" alt="Statok.net" /></a>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter32476165 = new Ya.Metrika({
id:32476165,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/32476165" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<!-- Rating@Mail.ru counter -->
<script type="text/javascript">
var _tmr = _tmr || [];
_tmr.push({id: "2690082", type: "pageView", start: (new Date()).getTime()});
(function (d, w, id) {
if (d.getElementById(id)) return;
var ts = d.createElement("script"); ts.type = "text/javascript"; ts.async = true; ts.id = id;
ts.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//top-fwz1.mail.ru/js/code.js";
var f = function () {var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ts, s);};
if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); }
})(document, window, "topmailru-code");
</script><noscript>
<img src="//top-fwz1.mail.ru/counter?id=2690082;js=na" style="border:0;" height="1" width="1" alt="Рейтинг@Mail.ru" />
</noscript>
<!-- //Rating@Mail.ru counter --></div>
</body>
</html>';
}else{
if (isset($_POST['login']) and !empty($_POST['login'])) {$login = vvod($_POST['login']);} else
{
go("/auth?err=c4ca4238a0b923820dcc509a6f75849b");
}
if (isset($_POST['pass']) and !empty($_POST['pass'])) {$pass = vvod($_POST['pass']);} else
{
go("/auth?err=c81e728d9d4c2f636f067f89cc14862c");
}
/*** выводим фильтруем данные страницы ***/
$md5=md5(md5($login.$pass));
$user = mysqli_fetch_array(mysqli_query($link,"SELECT * FROM `users` WHERE login='$login' and pass='$md5'"));
if(empty($user))
{
go("/auth?err=eccbc87e4b5ce2fe28308fd9f2a7baf3");
}
else
{
$random="r=".rand( 1000, 9999 );
$session=$user['session'];
/*** обновляем код игрока ***/
mysqli_query($link,"UPDATE `users` SET `session`='$session' where `id`='".num($user['id'])."'");
$usc=$user['id'];
setcookie("id",$usc,time()+1500*60*60);
setcookie("session",$session,time()+1500*60*60);
/*** узнаем ip и oc ***/
$ip=addslashes(getenv("REMOTE_ADDR"));
$timess=date("Y-m-d G:i:s", time());
$os=addslashes(getenv("HTTP_USER_AGENT"));
$user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
if ( stristr( $user_agent, 'Opera Mini' ) ) { $user_agent = isset( $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] ) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : $user_agent; }
$user_agent=htmlspecialchars(stripslashes(strtok($user_agent, '/')));
$ua=htmlspecialchars(stripslashes(strtok($user_agent, '/')));
/*** заносим данные в базу ***/
$a = mysqli_query($link,"SELECT * FROM `logi_ip` WHERE `ip`='$ip' AND `id_user`='".num($user['id'])."'");
if(mysqli_num_rows($a) == 0){mysqli_query($link,"INSERT INTO `logi_ip` (`id`,`id_user`,`ip`,`os`,`user_agent`,`data`)VALUES ('','".num($user['id'])."','$ip','$os','$user_agent','".time()."')");}
go("/game");
}
}
?>