File size: 1.05Kb
<?php
// mod by Пират
//-------------------- Сессии --------------------//
session_name("SID");
session_start();
if(isset($_SESSION['login'])){
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login`='".$_SESSION['login']."';"));
}else{$user = array(); }
if(isset($user['login'])){
if ($user[ban] > time()){
if ($_SERVER["SCRIPT_NAME"] != '/ban.php'){
header ("Location: $config_home/ban.php"); exit;}}
mysql_query("UPDATE `users` SET `time`='".time()."' WHERE `id` = '$user[id]'");
}
//-------------------------------------------------//
//-------------------- Cookies --------------------//
if(isset($_COOKIE['login'])){
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login`='".$_COOKIE['login']."';"));
}else{$user = array(); }
if(isset($user['login'])){
if ($user[ban] > time()){
if ($_SERVER["SCRIPT_NAME"] != '/ban.php'){
header ("Location: $config_home/ban.php"); exit;}}
mysql_query("UPDATE `users` SET `time`='".time()."' WHERE `id` = '$user[id]'");
}
//-------------------------------------------------//
?>