forked from rigamrts/rigaaowow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
138 lines (131 loc) · 3.04 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
// Настройка шаблонизатора и ДБ
include('includes/kernel.php');
if(isset($_COOKIE['remember_me']) && !isset($_SESSION['username']))
{
$_SESSION['username'] = substr($_COOKIE['remember_me'], 0, strlen($_COOKIE['remember_me'])-40);
$_SESSION['shapass'] = substr($_COOKIE['remember_me'], strlen($_COOKIE['remember_me'])-40, 40);
}
if(isset($_SESSION['username']) && isset($_SESSION['shapass']))
{
$user = array();
$user = CheckPwd($_SESSION['username'], $_SESSION['shapass']);
$_SESSION['userid'] = $user['id'];
$_SESSION['roles'] = $user['roles'];
if($user > 0)
$smarty->assign('user', $user);
else
unset($user);
}
$smarty->assign('locale', $_SESSION['locale']);
$smarty->assign('language', $locales[$_SESSION['locale']]);
$conf_file = $locales[$_SESSION['locale']].'.conf';
$smarty->assign('conf_file', $conf_file);
// Параметры передаваемые скрипту
$queryx = $_SERVER['QUERY_STRING'];
$smarty->assign('query', $queryx);
// Отсекаем ненужные данные
list($str, $trash) = explode('&', $queryx, 2);
// Получаем раздел и подраздел (или значение)
list($razdel, $podrazdel) = explode('=', $str, 2);
// Параметры страницы
global $page;
$page = array(
'Mapper' => false,
'Book' => false,
'Title' => '',
'tab' => 0,
'type' => 0,
'typeid' => 0,
'path' => '[]'
);
// В зависимости от раздела, выбираем что открывать:
switch($razdel)
{
case 'locale':
// Изменение языка сайта
// Проверка на корректность данных происходит в checklocale()
$_SESSION['locale'] = $podrazdel;
checklocale();
header('Location: '.($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : '.'));
break;
case 'account':
include 'account.php';
break;
case 'achievements':
include 'achievements.php';
break;
case 'achievement':
include 'achievement.php';
break;
case 'comment':
include 'comment.php';
break;
case 'event':
include 'event.php';
break;
case 'events':
include 'events.php';
break;
case 'faction':
include 'faction.php';
break;
case 'factions':
include 'factions.php';
break;
case 'item':
include 'item.php';
break;
case 'items':
include 'items.php';
break;
case 'itemset':
include 'itemset.php';
break;
case 'itemsets':
include 'itemsets.php';
break;
case 'latest':
include 'latest.php';
break;
case 'maps':
include 'maps.php';
break;
case 'npc':
include 'npc.php';
break;
case 'npcs':
include 'npcs.php';
break;
case 'object':
include 'object.php';
break;
case 'objects':
include 'objects.php';
break;
case 'quest':
include 'quest.php';
break;
case 'quests':
include 'quests.php';
break;
case 'search':
include 'search.php';
break;
case 'spell':
include 'spell.php';
break;
case 'spells':
include 'spells.php';
break;
case 'talent':
include 'talent.php';
break;
case 'data':
include 'data.php';
break;
default:
include 'main.php';
break;
}
?>