php require_once engine autoload php _SESSION block system vars id emp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require_once('engine/autoload.php');
$_SESSION['block'] = 0;
// system vars
$id = (empty($_GET['id']) ? null : intval($_GET['id']));
$act = (empty($_GET['act']) ? null : trim($_GET['act']));
$page = (empty($_GET['page']) ? 1 : intval($_GET['page']));
$max = 10;
$start_page = (($page - 1) * $max);
// pages loader
$url = substr($_SERVER['REQUEST_URI'], 1);
$GetInfo = explode('/', $url);
Security::files_micro_protect();
if (empty($GetInfo[1])) {
$GetInfo[1] = 'index';
}
if($_SESSION['block'] == 1){
include_once('modules/main/block.php');
}
else if (empty($url)) {
require_once(ROOT . "/modules/main/index.php");
}
/*
else if(!preg_match("^[a-zA-Z0-9]+$",$GetInfo[0]) or !preg_match("^[a-zA-Z0-9]+$",$GetInfo[1])){
exit('Запрещенныые символы в url');
}
*/
else if (!file_exists(ROOT . "/modules/$GetInfo[0]/$GetInfo[1].php")) {
exit("<h1>404 страница не найдена</h1>");
}
else {
$GetInfo[0] = (empty($GetInfo[0]) ? 'main' : $GetInfo[0]);
include_once("modules/$GetInfo[0]/$GetInfo[1].php");
}
//hgtr echo Core::hash_password('as123255646');