-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.php
More file actions
executable file
·61 lines (35 loc) · 1.2 KB
/
Copy pathsetup.php
File metadata and controls
executable file
·61 lines (35 loc) · 1.2 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?
if(!defined('FS_ROOT'))
die('access denided (setup file)');
$GLOBALS['__vikOffTimerStart__'] = microtime(1);
if (!defined('IS_CLI'))
define('IS_CLI', PHP_SAPI === 'cli');
// подключение ядра
require_once(FS_ROOT.'core/Func.core.php');
require_once(FS_ROOT.'core/App.core.php');
// установка обработчика ошибок
set_error_handler(array('Error', 'error_handler'));
// права пользователей
define('PERMS_UNREG', 0);
define('PERMS_REG', 10);
define('PERMS_MODERATOR', 20);
define('PERMS_ADMIN', 30);
define('PERMS_SUPERADMIN', 40);
define('PERMS_ROOT', 50);
// подключение конфигурационного файла
require_once('config/application.php');
require_once('config/utils.php');
// инициализация объекта request
Request::get();
// инициализация текущего пользователя
try {
CurUser::init();
} catch (Exception $e) {
CurUser::logout();
App::reload();
}
define('USER_AUTH_ID', CurUser::get()->getAuthData('id'));
define('USER_AUTH_PERMS', CurUser::get()->getAuthData('perms'));
// прочие константы
define('FORMCODE', App::getFormCodeInput());
?>