/*** Класс проверки и блокировки ip-адреса. */ class BotBlockIp { /*** Время блокировки в секундах. */ const blockSeconds = 60; /** * Интервал времени запросов страниц. */ const intervalSeconds = 1; /** * Количество запросов страницы в интервал времени. */ const intervalTimes = 4; /** * Флаг подключения всегда активных пользователей. */ const isAlwaysActive = true; /** * Флаг подключения всегда заблокированных пользователей. */ const isAlwaysBlock = true; /** * Путь к директории кэширования активных пользователей. */ const pathActive = 'active'; /** * Путь к директории кэширования заблокированных пользователей. */ const pathBlock = 'block'; /** * Флаг абсолютных путей к директориям. */ const pathIsAbsolute = false; /** * Список всегда активных пользователей. */ public static $alwaysActive = array( ); /** * Список всегда заблокированных пользователей. */ public static $alwaysBlock = array( ); /** * Метод проверки ip-адреса на активность и блокировку. */ public static function checkIp() { // Если это поисковый бот, то выходим ничего не делая if(self::is_bot()){ return; } // Получение ip-адреса $ip_address = self::_getIp(); // Пропускаем всегда активных пользователей if (in_array($ip_address, self::$alwaysActive) && self::isAlwaysActive) { return; } // Блокируем всегда заблокированных пользователей if (in_array($ip_address, self::$alwaysBlock) && self::isAlwaysBlock) { header('HTTP/1.0 403 Forbidden'); echo ''; echo ''; echo '
'; echo '';
echo 'Вы заблокированы администрацией ресурса.
';
exit;
}
// Установка путей к директориям
$path_active = self::pathActive;
$path_block = self::pathBlock;
// Приведение путей к директориям к абсолютному виду
if (!self::pathIsAbsolute) {
$path_active = str_replace('\\' , '/', dirname(__FILE__) . '/' . $path_active . '/');
$path_block = str_replace('\\' , '/', dirname(__FILE__) . '/' . $path_block . '/');
}
// Проверка возможности записи в директории
if (!is_writable($path_active)) {
die('Директория кэширования активных пользователей не создана или закрыта для записи.');
}
if (!is_writable($path_block)) {
die('Директория кэширования заблокированных пользователей не создана или закрыта для записи.');
}
// Проверка активных ip-адресов
$is_active = false;
if ($dir = opendir($path_active)) {
while (false !== ($filename = readdir($dir))) {
// Выбирается ip + время активации этого ip
if (preg_match('#^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})_(\d+)$#', $filename, $matches)) {
if ($matches[2] >= time() - self::intervalSeconds) {
if ($matches[1] == $ip_address) {
$times = intval(trim(file_get_contents($path_active . $filename)));
if ($times >= self::intervalTimes - 1) {
touch($path_block . $filename);
unlink($path_active . $filename);
} else {
file_put_contents($path_active . $filename, $times + 1);
}
$is_active = true;
}
} else {
unlink($path_active . $filename);
}
}
}
closedir($dir);
}
// Проверка заблокированных ip-адресов
$is_block = false;
if ($dir = opendir($path_block)) {
while (false !== ($filename = readdir($dir))) {
// Выбирается ip + время блокировки этого ip
if (preg_match('#^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})_(\d+)$#', $filename, $matches)) {
if ($matches[2] >= time() - self::blockSeconds) {
if ($matches[1] == $ip_address) {
$is_block = true;
$time_block = $matches[2] - (time() - self::blockSeconds) + 1;
}
} else {
unlink($path_block . $filename);
}
}
}
closedir($dir);
}
// ip-адрес заблокирован
if ($is_block) {
header('HTTP/1.0 502 Bad Gateway');
echo '';
echo '';
echo '
';
echo 'К сожалению, Вы временно заблокированы, из-за частого запроса страниц сайта.
';
echo 'Вам придется подождать. Через ' . $time_block . ' секунд(ы) Вы будете автоматически разблокированы.';
echo '
Schedule: Constantly
|
Order processing: around the clock
El Abyar
Indications for use:
For potency
Release form:
Capsules
Best before date:
2 years
Storage conditions:
Store at a temperature not exceeding 25 ° C. Keep out of reach of children
Holiday conditions:
Over the counter
Amount in a package:
60 pcs
Packaging:
Plastic jar
Shop Medic Store recommends paying attention to male libido enhancer - Epimedium Eroctin! It is perfectly balanced in terms of efficiency and care. Thanks to well-chosen natural ingredients. You will be able to see excellent results after the first application! Buy Epimedium Eroctin with profit 50% only we can, the price will be: 499 LD! Delivery works in El Abyar.
We will tell you everything about this product, offer the best conditions and introduce you to suitable promotional offers!
We will contact you within 10-15 minutes
Enter the verification number from the product packaging to confirm originality.
We are constantly working to ensure that it is profitable for our customers to shop with us - this is our main priority.
Time is a valuable resource and we value your time. Therefore, we do our best to ensure fast delivery of orders. Average delivery time is 3 days thanks to our process optimization and local warehouses.
You can be completely sure of the quality of the goods you buy on our website. We carefully inspect each item before shipping to ensure the highest level of quality.
Our goal is to help customers make the right choice when buying products, ensuring the safety and effectiveness of our products. After placing an order, our specialist will contact you to advise you on any of your questions and provide information that will allow you to achieve maximum efficiency.