/
index_bck_3_12_2014.php
174 lines (141 loc) · 4.51 KB
/
index_bck_3_12_2014.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
/*======================================================================*\
|| #################################################################### ||
|| # Rhino Socket 2.0 # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright 2014 Rhino All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- Rhino IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.livesupportrhino.com # ||
|| #################################################################### ||
\*======================================================================*/
// prevent direct php access
define('LS_PREVENT_ACCESS', 1);
if (!file_exists('config.php')) {
die('[index.php] config.php not exist');
}
require_once 'config.php';
$page = ($tempp ? filter_var($tempp, FILTER_SANITIZE_STRING) : '');
$page1 = ($tempp1 ? filter_var($tempp1, FILTER_SANITIZE_STRING) : '');
$page2 = ($tempp2 ? filter_var($tempp2, FILTER_SANITIZE_STRING) : '');
$page3 = ($tempp3 ? filter_var($tempp3, FILTER_SANITIZE_STRING) : '');
$page4 = ($tempp4 ? filter_var($tempp4, FILTER_SANITIZE_STRING) : '');
// Import the language file
if ($BT_LANGUAGE && file_exists(APP_PATH.'lang/'.$BT_LANGUAGE.'.ini')) {
$tl = parse_ini_file(APP_PATH.'lang/'.$BT_LANGUAGE.'.ini', true);
} elseif (!$BT_LANGUAGE && file_exists(APP_PATH.'lang/'.LS_LANG.'.ini')) {
$tl = parse_ini_file(APP_PATH.'lang/'.LS_LANG.'.ini', true);
} else {
$tl = parse_ini_file(APP_PATH.'lang/en.ini', true);
}
// If Referer Zero go to the session url
if (!isset($_SERVER['HTTP_REFERER'])) {
if ($_SESSION['ls_lastURL']) {
$_SERVER['HTTP_REFERER'] = $_SESSION['ls_lastURL'];
} else {
$_SERVER['HTTP_REFERER'] = BASE_URL;
}
}
// Lang and pages file for template
define('LS_SITELANG', LS_LANG);
// Assign Pages to template
define('LS_PAGINATE_ADMIN', 0);
// Define the avatarpath in the settings
define(LS_FILEPATH_BASE, BASE_URL.LS_FILES_DIRECTORY);
// Define the real request
$realrequest = substr($getURL->lsRealrequest(), 1);
define('LS_PARSE_REQUEST', $realrequest);
// Get the users ip address
$ipa = get_ip_address();
// Check if the ip is blocked, if so redirect to contact page with a message
if (defined(LS_IP_BLOCK)) {
$blockedips = explode(',', LS_IP_BLOCK);
if (in_array($ipa, $blockedips)) {
$USR_IP_BLOCKED = $tl['error']['e11'];
}
}
// Now get the available departments
$lv_departments = online_operators($LV_DEPARTMENTS, $page3, $page4);
// Finally get the captcha if wish so
if (LS_CAPTCHA) {
if (isset($_SESSION['jrc_captcha'])) {
$human_captcha = explode(':#:', $_SESSION['jrc_captcha']);
$random_name = $human_captcha[0];
$random_value = $human_captcha[1];
} else {
$random_name = rand();
$random_value = rand();
$_SESSION['jrc_captcha'] = $random_name.':#:'.$random_value;
}
}
// Set the check page to 0
$LS_CHECK_PAGE = 0;
// let's do the dirty work
if ($page == 'start') {
if ($lv_departments && !$USR_IP_BLOCKED) {
if (!LS_CHAT_DIRECT) {
require_once 'quickstart.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
} else {
require_once 'start.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
} else {
require_once 'contact.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
}
// Start the chat
if ($page == 'chat') {
require_once 'chat.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// Stop and Feedback the chat
if ($page == 'feedback') {
require_once 'feedback.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// Stop the chat
if ($page == 'stop') {
require_once 'stop.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// Stop the chat
if ($page == 'contact') {
require_once 'contact.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// Get the button
if ($page == 'b') {
require_once 'button.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// Get the safari fix page
if ($page == 'safari') {
$PAGE_TITLE = 'Safari ';
require_once 'safari.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// Get the 404 page
if ($page == '404') {
$PAGE_TITLE = '404 ';
require_once '404.php';
$LS_CHECK_PAGE = 1;
$PAGE_SHOWTITLE = 1;
}
// if page not found
if ($LS_CHECK_PAGE == 0) {
ls_redirect(LS_rewrite::lsParseurl('404', '', '', '', ''));
}
// Finally close all db connections
$lsdb->ls_close();
?>