File size: 1.46Kb
<?php
defined('WBCAT') or die('Restricted access');
ob_start();
session_start();
error_reporting(E_ALL & ~E_NOTICE);
require_once ('config.php');
require_once ('func.php');
# Проверяем ip-адрес на наличие бана #
if(isset($_SERVER['HTTP_X_REAL_IP'])) {
$ip2 = $_SERVER['HTTP_X_REAL_IP'];
} else {
$ip2 = $_SERVER['REMOTE_ADDR'];
}
$ip2 = ip2int($ip2);
$isset = mysql_query("SELECT `ip`,`reason`,`type`,`url` FROM `ban_ip` WHERE `ip`='".$ip2."' LIMIT 1");
if (mysql_num_rows($isset) > 0) {
$res = mysql_fetch_array($isset);
// Полная блокировка
if ($res['type'] == 1) {
echo 'Ваш ip-адрес забанен ! Причина <br/> '.( !empty($res['reason']) ? $res['reason'] : 'причина не указана' ).' ';
exit;
}
// Редирект по ссылке
if ($res['type'] == 2) {
header("Location: " . $res['url']);
exit;
}
}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="'.$settings['url'].'/style.css">
<title>Белый wap каталог</title></head>
<div class="head"><img src="'.$settings['url'].'/images/logo.png" alt="logo"/></div>';
?>