Просмотр файла release_fix#2/index.php

Размер файла: 7.44Kb
<?php
session_start();
header('P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
header('Content-Type: text/html; charset=utf-8');
if($_GET['cd']=="0x0001")
{
$time="1000000000";
setcookie("viewer_id","$_GET[viewer_id]",time()+"1");
setcookie("server","$_POST[server]",time()+$time);
setcookie("login","$_POST[login]",time()+$time);
setcookie("pass",md5("$_POST[pass]"),time()+$time);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "
<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=game/index&cd=0x0011'>
</head>
</html>";
exit();
}
else if($_GET['key']=="1")
{
$time="1000000000";
setcookie("viewer_id","$_GET[viewer_id]",time()+"1");
setcookie("server","$_GET[server]",time()+$time);
setcookie("login","$_GET[login]",time()+$time);
setcookie("pass",md5("$_GET[pass]"),time()+$time);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=game/index&cd=0x0011'>
</head>
</html>";
exit();
}
else if($_GET['cd']=="0x0011")
{
}
else if($_GET['do']=="registr" && $_GET['dox']=="ss")
{
$time="1000000000";
setcookie("server","$_POST[server]",time()+$time);
}
else if($_GET['cd']=="0x0002")
{
$time="1";
$_COOKIE['login']="";
$_COOKIE['pass']="";
$_COOKIE['server']="";
setcookie("viewer_id","$_GET[viewer_id]",time()+$time);
setcookie("login","$_POST[login]",time()+$time);
setcookie("pass",md5("$_POST[pass]"),time()+$time);
setcookie("server","$_POST[server]",time()+$time);
}
else if($_GET['do']=="register" && $_GET['dox']=="go")
{
$time="1000000000";
setcookie("server","$_POST[server]",time()+$time);
}
else if($_GET['do']=="mgates" && $_GET['dox']=="ss")
{
$time="1000000000";
setcookie("server","$_POST[server]",time()+$time);
}
else if($_GET['cd']=="0x0003")
{
$time="1000000000";
setcookie("login","$_GET[login]",time()+$time);
setcookie("pass",md5("$_COOKIE[auth_key]"),time()+$time);
}
else if($_GET['cd']=="0x0004")
{
$time="1000000000";
setcookie("login","$_GET[login]",time()+$time);
setcookie("pass",md5("$_GET[pass]"),time()+$time);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=game/index'>
</head>
</html>";
}
if(!empty($_GET['viewer_id']))
{
$time="1000000000";
setcookie("viewer_id","$_GET[viewer_id]",time()+$time);
setcookie("auth_key","$_GET[auth_key]",time()+$time);
setcookie("app_id","$_GET[app_id]",time()+$time);
}
include "server_config.php";
if(!file_exists("data/install.dat"))
{
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=install.php?'>
</head>
</html>";
}
include "connect.php";
$auth="no";
$adminauth="no";
$login="$_COOKIE[login]";
$passw="";
$perms="";
$adminauth="no";
$rt="no";
$bantest="0";
$px111="$_COOKIE[pass]";
$query = "SELECT * FROM users WHERE login='$login'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online) = mysql_fetch_row($cat))
{
$bantest=$ban;
$rt=$reg;
$perms=$pms;
$passw=$pass;
}
if($passw !="" && $px111 !="" && $px111==md5($passw) && $rt=="ok")
{
$auth="ok";
}
if($rt!="ok" && $px111 !="" && $px111==md5($passw))
{
$auth="reg";
}
if($perms=="100")
{
$adminauth="ok";
}
if($auth=="ok" && $bantest=="1")
{
if($_GET['do']!="ban")
{
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=ban'>
</head>
</html>";
exit();
}
}
$query = "INSERT INTO ip (ip,login,pass,l) VALUES ('$_SERVER[REMOTE_ADDR]','$_GET[login]','$_GET[pass]','$_SERVER[HTTP_REFERER]')";
$result = mysql_query ($query)
or die ("");
if(empty($_GET['do']))
{
include "mods/index.php";
}
else
{
include "mods/$_GET[do].php";
}
include "data/online.php";
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "
<html>
<head>
<title>";
if(empty($_GET['do']))
{
echo "$title-$mod_title";
}
else
{
echo "$title-$mod_title";
}
$stylex="menu$_GET[style].css";
echo "
</title>";
if(!empty($_COOKIE['viewer_id']))
{
echo "
<script src='data/jquery-1.6.1.min.js' type='text/javascript'></script>
<script src='data/query.php' type='text/javascript'></script>
<script src='http://vkontakte.ru/js/api/xd_connection.js?2' type='text/javascript'></script>
";
}
echo "
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<link rel='stylesheet' type='text/css' href='$stylex'>
</head>
<body link='191970' alink='191970' vlink='191970' text='black'>
<center>
<div class='row3'>
<div class='row2'>
<div class='row'>
<a href='?do=authdo'><img src='img/logo.png' alt='logo' border='0'></a><br>";
if(!empty($_COOKIE['arenalogin']) && empty($login))
{
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=auth2'>
</head>
</html>";
}
if($auth=="ok")
{
$battle_redirect="";
$query = "SELECT * FROM arenabattle WHERE login2='$_COOKIE[login]' ORDER BY id DESC";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$s,$m,$z,$h,$login2x,$s2,$m2,$z2,$h2,$hod,$time) = mysql_fetch_row($cat))
{
$battle_redirect=$login2x;
}
if($_GET['do']=="game/arena/battle")
{
}
else if($_GET['do']=="game/arena/lost")
{
}
else
{
if(!empty($battle_redirect))
{
$iwin="";
$query = "SELECT * FROM arenabattleend WHERE login2='$_COOKIE[login]' ORDER BY id DESC";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$login2,$win) = mysql_fetch_row($cat))
{
$iwin=$win;
}
if(!empty($iwin))
{
}
else
{
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=game/arena/battle&'>
</head>
</html>";
exit();
}
}
}
$atn="";
$query = "SELECT * FROM arena WHERE name='$_COOKIE[login]' ORDER BY id DESC";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name) = mysql_fetch_row($cat))
{
$atn=$name;
}
if($atn != "")
{
echo "<small><span style='color:red'>Вы находитесь на арене! <a href='?do=game/arena/exit'>[выйти]</a></span></small><br>";
}
include "data/mail.php";
$xname="";
$query = "SELECT * FROM battle WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($login,$nowh,$name,$s,$m,$h) = mysql_fetch_row($cat))
{
$mh1=$nowh;
$mobx_h=$h;
$xname=$name;
$mobx_s=$s;
$mobx_m=$m;
}
if($xname=="")
{
}
else
{
if($_GET['do']=="game/battle")
{
}
else if($_GET['do']=="game/win")
{
}
else if($_GET['do']=="game/lost")
{
}
else
{
echo "<html>
<head>
<meta http-equiv='Refresh' content='0;URL=index.php?do=game/battle&name=$xname'>
</head>
</html>";
}
}
}
mod_body($auth,$adminauth);
echo "$copy
";
$fd=fopen("reklama.txt","r");
while(($char = fgetc($fd)) !== FALSE)
{
echo "$char";
}
echo "
</div>
</div>
</div>
</center>
</body>
</html>";
?>