View file pages/error.php

File size: 2.75Kb
<?php
#-----------------------------------------------------#
#          ********* ROTORCMS *********               #
#              Made by  :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#
require_once ('../includes/start.php');
require_once ('../includes/functions.php');
require_once ('../includes/header.php');

$error = (isset($_GET['error'])) ? intval($_GET['error']) : '';

if (!empty($config['errorlog'])){

	switch ($error):
	############################################################################################
	##                                       Ошибка 403                                       ##
	############################################################################################
	case '403':

		DB::run()->query("INSERT INTO `error` (`error_num`, `error_request`, `error_referer`, `error_username`, `error_ip`, `error_brow`, `error_time`) VALUES (?, ?, ?, ?, ?, ?, ?);", array(403, $request_uri, $http_referer, $username, $ip, $brow, SITETIME));

		DB::run()->query("DELETE FROM `error` WHERE `error_num`=? AND `error_time` < (SELECT MIN(`error_time`) FROM (SELECT `error_time` FROM `error` WHERE `error_num`=? ORDER BY `error_time` DESC LIMIT ".$config['maxlogdat'].") AS del);", array(403, 403));

		$_SESSION['note'] = 'ERROR 403. Недопустимый запрос!';
	break;

	############################################################################################
	##                                       Ошибка 403                                       ##
	############################################################################################
	case '404':
		DB::run()->query("INSERT INTO `error` (`error_num`, `error_request`, `error_referer`, `error_username`, `error_ip`, `error_brow`, `error_time`) VALUES (?, ?, ?, ?, ?, ?, ?);", array(404, $request_uri, $http_referer, $username, $ip, $brow, SITETIME));

		DB::run()->query("DELETE FROM `error` WHERE `error_num`=? AND `error_time` < (SELECT MIN(`error_time`) FROM (SELECT `error_time` FROM `error` WHERE `error_num`=? ORDER BY `error_time` DESC LIMIT ".$config['maxlogdat'].") AS del);", array(404, 404));

		$_SESSION['note'] = 'ERROR 404. Извините, но такой страницы не существует!';
	break;

	endswitch;
}

redirect($config['home'].'/index.php?'.SID);
?>