Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. <?php
  2. /*if($_SERVER['REMOTE_ADDR']!="89.178.175.49" && $_SERVER['REMOTE_ADDR']!="62.182.74.218")
  3.  
  4. die("<div class=validation>!!!!!!!!!!</div>");*/
  5.  
  6.  
  7.  
  8. session_start();
  9.  
  10. include ("inc/config.php");
  11. include ("inc/sql_layer.php");
  12. include ("inc/utils.php");
  13. include ("inc/mysql.class.php");
  14. include ("inc/templates.class.php");
  15. include ("mysql.php");
  16.  
  17.  
  18. $dbi = sql_connect($dbhost, $dbuser, $dbpass, $dbname);
  19.  
  20.  
  21. $usrip=$_SERVER['REMOTE_ADDR'];
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. if($_COOKIE["member_id"]=="" && $_COOKIE["pass_hash"]=="")
  29. {
  30. $fa_userid=$_SESSION["member_id"];
  31. $fa_userps=$_SESSION["pass_hash"];
  32.  
  33. }else
  34. {
  35. $fa_userid=$_COOKIE["member_id"];
  36. $fa_userps=$_COOKIE["pass_hash"];
  37. $_SESSION["member_id"]=$_COOKIE["member_id"];
  38. $_SESSION["pass_hash"]=$_COOKIE["pass_hash"];
  39. }
  40.  
  41.  
  42. if ($fa_userid!="")
  43. {
  44. //check and get
  45. $cnt=execsqlone("select count(*) from sys_users where id='$fa_userid' and pass='$fa_userps'");
  46. if ($cnt>0) {
  47. $res=sql_query("select * from sys_users where id='$fa_userid' and pass='$fa_userps'",$dbi);
  48. $row=sql_fetch_object($res,$dbi);
  49. sql_free_result($res);
  50. $fa_userlevel=$row->user_level;
  51. $fa_lastvisit=$row->last_visit;
  52. $fa_username=$row->name;
  53. $fa_isadmin=$row->is_admin;
  54. $fa_user_klan=$row->klan;
  55. $fa_user_money = $row->f_money;
  56. $fa_mgroup=$row->mgroup;
  57. sql_query("update sys_users set last_activity='".time()."', ip_address='$usrip' where id='$fa_userid'",$dbi);
  58.  
  59. if ($fa_isadmin==1)
  60. {
  61. $fa_perm=ExecSQLOne("select modules from sys_adminperm where user_id='$fa_userid'");
  62. }
  63. }
  64. else
  65. {
  66. $fa_userid="";
  67. $fa_userps="";
  68. $fa_isadmin=0;
  69. $fa_username="";
  70. $fa_lastvisit="";
  71. $fa_userlevel=0;
  72. }
  73.  
  74. }
  75.  
  76.  
  77. if($fa_isadmin!=1) {include ("inc/security.php");} // Фильтр фходящих данных (H2O2+Aceton)
  78. if($fa_isadmin==1) {include ("inc/security_admin.php");}
  79. if ($op=="logout")
  80. {
  81. setcookie("member_id","",0);
  82. setcookie("pass_hash","",0);
  83. session_unregister("member_id");
  84. session_unregister("pass_hash");
  85. $fa_userid=$_SESSION["member_id"];
  86. $fa_userps=$_SESSION["pass_hash"];
  87. header("location: /index.php");
  88. }
  89. if(!isset($fa_userid) || ($fa_userid==""))
  90. {
  91.  
  92. $resg=sql_query("select * from sys_guest where ip='$usrip'",$dbi);
  93.  
  94. if(sql_num_rows($resg,$dbi)=="0")
  95. {
  96. sql_query("INSERT INTO sys_guest (ip, mod_now, last_active) VALUES ('$usrip', '$mod', '".time()."')",$dbi);
  97.  
  98. }
  99. else
  100. {
  101. sql_query("UPDATE sys_guest set mod_now='$mod', last_active='".time()."'
  102. where ip='$usrip'",$dbi);
  103.  
  104. }
  105. }
  106.  
  107.  
  108. if (!isset($mod) || ($mod==""))
  109. {
  110. $mod="news";// Модуль по умолчанию.
  111. }
  112. $res=sql_query("select * from sys_mods where sysname='$mod' and is_active=1",$dbi);
  113. if (sql_num_rows($res,$dbi)==1)
  114. {
  115. $in_row=sql_fetch_object($res,$dbi);
  116. sql_free_result($res);
  117. $PAGE_TITLE=$in_row->mod_name;
  118. $mod_id=$in_row->id;
  119. $sys_noblocks=$in_row->sys_noblocks;
  120. include("mod/$in_row->filename");
  121.  
  122. }
  123. else
  124. {
  125. include("inc/top.php");
  126. echoerror("<br>Модуль lдоступен тока Группе(Тестерам)!",1);
  127. include("inc/bottom.php");
  128. }
  129.  
  130.  
  131.  
  132. sql_logout($dbi);
  133.  
  134. ob_end_flush();
  135. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement