Вход Регистрация
Файл: ulogin.php
Строк: 95
<?
include_once 'sys/core/start.php';
include_once 
'sys/core/compress.php';
include_once 
'sys/core/sess.php';
include_once 
'sys/core/home.php';
include_once 
'sys/core/settings.php';
include_once 
'sys/core/db_connect.php';
include_once 
'sys/core/ipua.php';
include_once 
'sys/core/fnc.php';
include_once 
'sys/core/user.php';
include_once 
'sys/inc/fnc_game.php';
include_once 
'sys/core/shif.php';

if (isset(
$_POST['token'])) {    $s file_get_contents('http://ulogin.ru/token.php?token=' $_POST['token'] . '&host=' $_SERVER['HTTP_HOST']);    $_POST['loginAPI'] = true; }

if (isset(
$_POST['token']))$users json_decode($strue);

if (isset(
$_POST['token']) && !isset($user) && $users['network'] && $users['identity'] && $_POST['loginAPI'] == true)
{
if (
mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `type_reg` = '" $users['network'] . "' AND `identity` = '" $users['identity'] . "'"),0) == 0)
{




if (
$users['network'] == 'odnoklassniki')
$idi 'ok';
else
$idi null;

$identity $users['identity'];
$identity str_replace('http://www.facebook.com'''$identity);
$identity str_replace('http://openid.yandex.ru'''$identity);
$identity str_replace('http://vk.com'''$identity);
$identity str_replace('http://odnoklassniki.ru'''$identity);
$identity str_replace('http://my.mail.ru/mail'''$identity);
$identity str_replace('/'''$identity);
$identity str_replace('.'''$identity);
$identity $idi $identity;




if (
mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `nick` = '" $identity "'"),0)!=0)
$identity $identity '_' mt_rand(00009999);
$pass $passgen;
mysql_query("INSERT INTO `user` (`nick`, `pass`, `date_reg`, `date_last`, `identity`, `type_reg`)
values('
$identity', '" shif($pass) . "', '$time', '$time', '" $users['identity'] . "', '" $users['network'] . "')",$db);




$user=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `nick` = '"$identity ."' AND `pass` = '"shif($pass) ."' LIMIT 1"));
$_SESSION['reg_api_nick']=$identity;
$_SESSION['reg_api_pass']=$pass;
$_SESSION['id_user']=$user['id'];
setcookie('id_user'$user['id'], time()+60*60*24*365);
$_SESSION['ok_registration_api']=1;
header("Location: /index.php");
exit;

}else{

$user=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `type_reg` = '" $users['network'] . "' AND `identity` = '" $users['identity'] . "' LIMIT 1"));
$_SESSION['id_user'] = $user['id'];
setcookie('id_user'$user['id'], time() + 60 60 24 365);

mysql_query("UPDATE `user` SET `date_aut` = " time() . " WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `date_last` = " time() . " WHERE `id` = '$user[id]' LIMIT 1");
$_SESSION['message'] = 'Вы успешно авторизовались';
header("Location: /index.php");
exit;
    
}
}

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