Вход Регистрация
Файл: Dvig/core/core.php
Строк: 41
<?php
####################
## Автор - USER-X ##
## Copyright 2013 ##
## xcms.mcdir.ru  ##
####################
        
error_reportingE_ALL ) ;
        
defined'xcms_pro' ) or die( 'Идите нахуй!' ) ;
        list( 
$msec$sec ) = explode" "microtime() ) ;
        
$startss $sec $msec ;
        
#Подключаемые файлы
        
if ( ! isset( $path ) ) $path '' ;
        require_once 
$path 'core/set.php' ;
        require_once 
$path 'core/func.php' ;

        
#########################
        // Стартуем сессию
        
session_name"SES_LOC" ) ;
        
session_start() ;

        
#Принимае переменные#
        
$id = isset( $_GET['id'] ) ? absintval$_GET['id'] ) ) : false ;
        
$idu = isset( $_GET['idu'] ) ? absintval$_GET['idu'] ) ) : false ;
        
$act = isset( $_GET['act'] ) ? trim$_GET['act'] ) : '' ;
        
#########################

        #блок авторизации
        
if ( isset( $_SESSION['login'] ) && isset( $_SESSION['passw'] ) )
        {
                        
$id_user absintval$_SESSION['login'] ) ) ;
                        
$passw $_SESSION['passw'] ;
        }
        elseif ( isset( 
$_COOKIE['setlogin'] ) && isset( $_COOKIE['setpassw'] ) )
        {

                        
$id_user intvalbase64_decode$_COOKIE['setlogin'] ) ) ;
                        
$_SESSION['login'] = $id_user ;

                        
$passw md5$_COOKIE['setpassw'] . 'wadik112' ) ;
                        
$_SESSION['passw'] = $passw ;
        }

        if ( isset( 
$_SESSION['login'] ) && isset( $_SESSION['passw'] ) )
        {
                        
$usid intval$_SESSION['login'] ) ;
                        
$uspass $_SESSION['passw'] ;

                        if ( 
$usid && $uspass )
                        {
                                        
$ress mysql_query"SELECT * FROM `users` WHERE `id` = '$usid' LIMIT 1" ) ;
                                        if ( 
mysql_num_rows$ress ) )
                                        {
                                                        
$users mysql_fetch_assoc$ress ) ;
                                                        if ( 
$uspass == $users['password'] )
                                                        {

                                                                        
$idus $users['id'] ;
                                                                        
$login $users['login'] ;
                                                                        
$level $users['level'];
                                                                        
$name $users['name'] ;
                                                                        
$utime $users['time'] ;
                                                                        
$regtime $users['reg_time'] ;
                                                                        
mysql_query"UPDATE `users` SET `time` = '" time() . "' WHERE `id` = '" $idus .
                                                                                        
"' LIMIT 1" ) ;

                                                        }
                                                        else
                                                        {
                                                                        
// Если пароль не совпадает, уничтожаем переменные сессии и чистим куки
                                                                        
unset( $_SESSION['login'] ) ;
                                                                        unset( 
$_SESSION['passw'] ) ;
                                                                        
$usid false ;
                                                                        
$uspass false ;
                                                        }
                                        }
                                        else
                                        {
                                                        
// Если юзер не найден, уничтожаем переменные сессии
                                                        
unset( $_SESSION['login'] ) ;
                                                        unset( 
$_SESSION['passw'] ) ;
                                                        
$usid false ;
                                                        
$uspass false ;
                                        }
                        }

        }
        else
        {
                        
$usid false ;
                        
$idus false ;
        }
        
#подсчет онланй
        
if(!$users){
        
$sid md5$_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] ) ;
        
$req mysql_query"SELECT `id` FROM `online` WHERE `ses` = '$sid' LIMIT 1" ) ;
        if ( 
mysql_num_rows$req ) )
        {
mysql_query"UPDATE `online` SET
        `time` = '" 
time() . "'
        WHERE `ses` = '
$sid'" ) ;}
        else
        {
        
// Если еще небыло в базе, то добавляем запись
        
mysql_query"INSERT INTO `online` SET
        `ses` = '
$sid',
        `time` = '" 
time() . "'" ) ;
        }
        }
        
#постраничка
        
if ( ! isset( $_GET['page'] ) )
        {
$p 1;}
        else
        {
$p addslashesstrip_tagstrim$_GET['page'] ) ) ) ;
        if ( 
$p $p 1;}
        
$num_elements 5;
        
#################


?>
Онлайн: 2
Реклама