/
index.php
44 lines (30 loc) · 977 Bytes
/
index.php
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
<?php
header('Content-Type: text/html; charset= utf-8');
session_start();
require_once 'config.php';
require_once 'functions.php';
$categories = getCategories($mysql_link);
$types = get_type($mysql_link);
$user = checkUser($mysql_link);
if(!empty($user) and is_array($user)){
$add_mess = privileges($mysql_link, $user['role_id'], array('ADD_MESS'));
}
$action = clearData($mysql_link, $_GET['action']);
if(!$action){
$action = 'index';
}
$title = getTitle($mysql_link, $action, $user, $types, $categories);
$main_menu = getMainMenu($mysql_link, $user, $action);
if(file_exists('actions/' . $action . '.inc.php')){
include 'actions/' . $action . '.inc.php';
}else{
include 'actions/' . 'index.inc.php';
}
require_once THEME . 'index.tpl.php';
unset($_SESSION['msg']);
echo '<pre><br /><h4>Текущий пользователь</h4><br />';
print_r($user);
echo '</pre>';
echo '<pre><br /><h4>Данные SERVER</h4><br />';
print_r($_SERVER);
echo '</pre>';