Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*if($_SERVER['REMOTE_ADDR']!="89.178.175.49" && $_SERVER['REMOTE_ADDR']!="62.182.74.218")
- die("<div class=validation>!!!!!!!!!!</div>");*/
- session_start();
- include ("inc/config.php");
- include ("inc/sql_layer.php");
- include ("inc/utils.php");
- include ("inc/mysql.class.php");
- include ("inc/templates.class.php");
- include ("mysql.php");
- $dbi = sql_connect($dbhost, $dbuser, $dbpass, $dbname);
- $usrip=$_SERVER['REMOTE_ADDR'];
- if($_COOKIE["member_id"]=="" && $_COOKIE["pass_hash"]=="")
- {
- $fa_userid=$_SESSION["member_id"];
- $fa_userps=$_SESSION["pass_hash"];
- }else
- {
- $fa_userid=$_COOKIE["member_id"];
- $fa_userps=$_COOKIE["pass_hash"];
- $_SESSION["member_id"]=$_COOKIE["member_id"];
- $_SESSION["pass_hash"]=$_COOKIE["pass_hash"];
- }
- if ($fa_userid!="")
- {
- //check and get
- $cnt=execsqlone("select count(*) from sys_users where id='$fa_userid' and pass='$fa_userps'");
- if ($cnt>0) {
- $res=sql_query("select * from sys_users where id='$fa_userid' and pass='$fa_userps'",$dbi);
- $row=sql_fetch_object($res,$dbi);
- sql_free_result($res);
- $fa_userlevel=$row->user_level;
- $fa_lastvisit=$row->last_visit;
- $fa_username=$row->name;
- $fa_isadmin=$row->is_admin;
- $fa_user_klan=$row->klan;
- $fa_user_money = $row->f_money;
- $fa_mgroup=$row->mgroup;
- sql_query("update sys_users set last_activity='".time()."', ip_address='$usrip' where id='$fa_userid'",$dbi);
- if ($fa_isadmin==1)
- {
- $fa_perm=ExecSQLOne("select modules from sys_adminperm where user_id='$fa_userid'");
- }
- }
- else
- {
- $fa_userid="";
- $fa_userps="";
- $fa_isadmin=0;
- $fa_username="";
- $fa_lastvisit="";
- $fa_userlevel=0;
- }
- }
- if($fa_isadmin!=1) {include ("inc/security.php");} // Фильтр фходящих данных (H2O2+Aceton)
- if($fa_isadmin==1) {include ("inc/security_admin.php");}
- if ($op=="logout")
- {
- setcookie("member_id","",0);
- setcookie("pass_hash","",0);
- session_unregister("member_id");
- session_unregister("pass_hash");
- $fa_userid=$_SESSION["member_id"];
- $fa_userps=$_SESSION["pass_hash"];
- header("location: /index.php");
- }
- if(!isset($fa_userid) || ($fa_userid==""))
- {
- $resg=sql_query("select * from sys_guest where ip='$usrip'",$dbi);
- if(sql_num_rows($resg,$dbi)=="0")
- {
- sql_query("INSERT INTO sys_guest (ip, mod_now, last_active) VALUES ('$usrip', '$mod', '".time()."')",$dbi);
- }
- else
- {
- sql_query("UPDATE sys_guest set mod_now='$mod', last_active='".time()."'
- where ip='$usrip'",$dbi);
- }
- }
- if (!isset($mod) || ($mod==""))
- {
- $mod="news";// Модуль по умолчанию.
- }
- $res=sql_query("select * from sys_mods where sysname='$mod' and is_active=1",$dbi);
- if (sql_num_rows($res,$dbi)==1)
- {
- $in_row=sql_fetch_object($res,$dbi);
- sql_free_result($res);
- $PAGE_TITLE=$in_row->mod_name;
- $mod_id=$in_row->id;
- $sys_noblocks=$in_row->sys_noblocks;
- include("mod/$in_row->filename");
- }
- else
- {
- include("inc/top.php");
- echoerror("<br>Модуль lдоступен тока Группе(Тестерам)!",1);
- include("inc/bottom.php");
- }
- sql_logout($dbi);
- ob_end_flush();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement