Small update.
[iDB.git] / sql.php
blobbedc5ed143f922c75c2118e03ac237ee64620b6f
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: sql.php - Last Update: 08/02/2011 SVN 738 - Author: cooldude2k $
16 /* Some ini setting changes uncomment if you need them.
17 Display PHP Errors */
18 $disfunc = @ini_get("disable_functions");
19 $disfunc = @trim($disfunc);
20 $disfunc = @preg_replace("/([\\s+|\\t+|\\n+|\\r+|\\0+|\\x0B+])/i", "", $disfunc);
21 if($disfunc!="ini_set") { $disfunc = explode(",",$disfunc); }
22 if($disfunc=="ini_set") { $disfunc = array("ini_set"); }
23 if(!in_array("ini_set", $disfunc)) {
24 @ini_set("html_errors", false);
25 @ini_set("track_errors", false);
26 @ini_set("display_errors", false);
27 @ini_set("report_memleaks", false);
28 @ini_set("display_startup_errors", false);
29 //@ini_set("error_log","logs/error.log");
30 //@ini_set("log_errors","On");
31 @ini_set("docref_ext", "");
32 @ini_set("docref_root", "http://php.net/"); }
33 @error_reporting(E_ALL ^ E_NOTICE);
34 /* Get rid of session id in urls */
35 if(!in_array("ini_set", $disfunc)) {
36 @ini_set("date.timezone","UTC");
37 @ini_set("default_mimetype","text/html");
38 @ini_set("zlib.output_compression", false);
39 @ini_set("zlib.output_compression_level", -1);
40 @ini_set("session.use_trans_sid", false);
41 @ini_set("session.use_cookies", true);
42 @ini_set("session.use_only_cookies", true);
43 @ini_set("url_rewriter.tags","");
44 @ini_set('zend.ze1_compatibility_mode', 0);
45 @ini_set("ignore_user_abort", 1); }
46 @set_time_limit(30); @ignore_user_abort(true);
47 /* Change session garbage collection settings */
48 if(!in_array("ini_set", $disfunc)) {
49 @ini_set("session.gc_probability", 1);
50 @ini_set("session.gc_divisor", 100);
51 @ini_set("session.gc_maxlifetime", 1440);
52 /* Change session hash type here */
53 @ini_set("session.hash_function", 1);
54 @ini_set("session.hash_bits_per_character", 6); }
55 /* Do not change anything below this line unless you know what you are doing */
56 $File3Name = basename($_SERVER['SCRIPT_NAME']);
57 if ($File3Name=="sql.php"||$File3Name=="/sql.php") {
58 header('Location: index.php');
59 exit(); }
60 if(file_exists('settings.php')) {
61 require_once('settings.php');
62 if(file_exists('extrasettings.php')) {
63 require_once('extrasettings.php'); }
64 if(file_exists('extendsettings.php')) {
65 require_once('extendsettings.php'); }
66 if(!in_array("ini_set", $disfunc)&&$Settings['qstr']!="/"&&$Settings['qstr']!="&") {
67 ini_set("arg_separator.output",htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']));
68 ini_set("arg_separator.input",$Settings['qstr']); } }
69 if(!isset($Settings['idburl'])) { $Settings['idburl'] = null; }
70 if(!isset($Settings['fixbasedir'])) { $Settings['fixbasedir'] = null; }
71 if(!isset($Settings['fixpathinfo'])) { $Settings['fixpathinfo'] = null; }
72 if(!isset($Settings['fixcookiedir'])) { $Settings['fixcookiedir'] = null; }
73 if(!isset($Settings['fixredirectdir'])) { $Settings['fixcookiedir'] = null; }
74 $Settings['bid'] = base64_encode(urlencode($Settings['idburl']));
75 if(!isset($Settings['idb_time_format'])) { $Settings['idb_time_format'] = "g:i A"; }
76 if(!isset($Settings['showverinfo'])) {
77 $Settings['showverinfo'] = "on"; }
78 if(!isset($Settings['sqldb'])) {
79 header("Content-Type: text/plain; charset=UTF-8");
80 header('Location: install.php'); }
81 if(!isset($Settings['fixpathinfo'])) {
82 $Settings['fixpathinfo'] = "off"; }
83 if($Settings['fixpathinfo']=="off") {
84 $Settings['fixpathinfo'] = null; }
85 if(!isset($Settings['fixbasedir'])) {
86 $Settings['fixbasedir'] = "off"; }
87 if($Settings['fixbasedir']=="off") {
88 $Settings['fixbasedir'] = null; }
89 if(!isset($Settings['fixcookiedir'])) {
90 $Settings['fixcookiedir'] = "off"; }
91 if($Settings['fixcookiedir']=="off") {
92 $Settings['fixcookiedir'] = null; }
93 if(!isset($Settings['fixredirectdir'])) {
94 $Settings['fixredirectdir'] = "off"; }
95 if($Settings['fixredirectdir']=="off") {
96 $Settings['fixredirectdir'] = null; }
97 $OldSettings['fixpathinfo'] = $Settings['fixpathinfo'];
98 $OldSettings['fixbasedir'] = $Settings['fixbasedir'];
99 $OldSettings['fixcookiedir'] = $Settings['fixcookiedir'];
100 $OldSettings['fixredirectdir'] = $Settings['fixredirectdir'];
101 if($Settings['idburl']=="localhost") {
102 header("Content-Type: text/plain; charset=UTF-8");
103 echo "500 Error: URL is malformed. Try reinstalling iDB."; die(); }
104 if($Settings['fixbasedir']=="on") {
105 if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
106 $PathsTest = parse_url($Settings['idburl']);
107 $Settings['fixbasedir'] = $PathsTest['path']."/";
108 $Settings['fixbasedir'] = str_replace("//", "/", $Settings['fixbasedir']); } }
109 if($Settings['fixcookiedir']=="on") {
110 if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
111 $PathsTest = parse_url($Settings['idburl']);
112 $Settings['fixcookiedir'] = $PathsTest['path']."/";
113 $Settings['fixcookiedir'] = str_replace("//", "/", $Settings['fixcookiedir']); } }
114 if($Settings['fixredirectdir']=="on") {
115 if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
116 $PathsTest = parse_url($Settings['idburl']);
117 $Settings['fixredirectdir'] = $PathsTest['path']."/";
118 $Settings['fixredirectdir'] = str_replace("//", "/", $Settings['fixredirectdir']); } }
119 if(!isset($Settings['charset'])) {
120 $Settings['charset'] = "ISO-8859-15"; }
121 if(isset($Settings['charset'])) {
122 if($Settings['charset']!="ISO-8859-15"&&$Settings['charset']!="ISO-8859-1"&&
123 $Settings['charset']!="UTF-8"&&$Settings['charset']!="CP866"&&
124 $Settings['charset']!="Windows-1251"&&$Settings['charset']!="Windows-1252"&&
125 $Settings['charset']!="KOI8-R"&&$Settings['charset']!="BIG5"&&
126 $Settings['charset']!="GB2312"&&$Settings['charset']!="BIG5-HKSCS"&&
127 $Settings['charset']!="Shift_JIS"&&$Settings['charset']!="EUC-JP") {
128 $Settings['charset'] = "ISO-8859-15"; } }
129 $chkcharset = $Settings['charset'];
130 if(!in_array("ini_set", $disfunc)) {
131 @ini_set('default_charset', $Settings['charset']); }
132 //session_save_path($SettDir['inc']."temp/");
133 if(!isset($Settings['sqldb'])) {
134 if(file_exists("install.php")) { header('Location: install.php'); die(); }
135 if(!file_exists("install.php")) { header("Content-Type: text/plain; charset=UTF-8");
136 echo "403 Error: Sorry could not find install.php\nTry uploading files again and if that dose not work try download iDB again."; die(); } }
137 if(isset($Settings['sqldb'])&&
138 function_exists("date_default_timezone_set")) {
139 @date_default_timezone_set("UTC"); }
140 if(!isset($Settings['sqlhost'])) { $Settings['sqlhost'] = "localhost"; }
141 if($Settings['fixpathinfo']=="on") {
142 $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
143 putenv("PATH_INFO=".$_SERVER['ORIG_PATH_INFO']); }
144 // Check to see if variables are set
145 if(!isset($SettDir['inc'])) { $SettDir['inc'] = "inc/"; }
146 if(!isset($SettDir['archive'])) { $SettDir['archive'] = "archive/"; }
147 if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; }
148 if(!isset($SettDir['sql'])) { $SettDir['sql'] = "inc/misc/sql/"; }
149 if(!isset($SettDir['admin'])) { $SettDir['admin'] = "inc/admin/"; }
150 if(!isset($SettDir['sqldumper'])) { $SettDir['sqldumper'] = "inc/admin/sqldumper/"; }
151 if(!isset($SettDir['mod'])) { $SettDir['mod'] = "inc/mod/"; }
152 if(!isset($SettDir['themes'])) { $SettDir['themes'] = "themes/"; }
153 if(!isset($SettDir['maindir'])||!file_exists($SettDir['maindir'])||!is_dir($SettDir['maindir'])) {
154 $SettDir['maindir'] = addslashes(str_replace("\\","/",dirname(__FILE__)."/")); }
155 if(isset($SettDir['maindir'])) { @chdir($SettDir['maindir']); }
156 if(!isset($Settings['use_iniset'])) { $Settings['use_iniset'] = null; }
157 if(!isset($Settings['clean_ob'])) { $Settings['clean_ob'] = "off"; }
158 if(!isset($_SERVER['PATH_INFO'])) { $_SERVER['PATH_INFO'] = null; }
159 if(!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
160 $_SERVER['HTTP_ACCEPT_ENCODING'] = null; }
161 if(!isset($_SERVER["HTTP_ACCEPT"])) { $_SERVER["HTTP_ACCEPT"] = null; }
162 if(!isset($_SERVER['HTTP_REFERER'])) { $_SERVER['HTTP_REFERER'] = null; }
163 if(!isset($_GET['page'])) { $_GET['page'] = null; }
164 if(!isset($_GET['act'])) { $_GET['act'] = null; }
165 if(!isset($_POST['act'])) { $_POST['act'] = null; }
166 if(!isset($_GET['modact'])) { $_GET['modact'] = null; }
167 if(!isset($_POST['modact'])) { $_POST['modact'] = null; }
168 if(!isset($_GET['id'])) { $_GET['id'] = null; }
169 if(!isset($_GET['debug'])) { $_GET['debug'] = "off"; }
170 if(!isset($_GET['post'])) { $_GET['post'] = null; }
171 if(!isset($_POST['License'])) { $_POST['License'] = null; }
172 if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = "off"; }
173 if(!isset($Settings['SQLThemes'])) { $Settings['SQLThemes'] = "off"; }
174 if($Settings['SQLThemes']!="on"&&$Settings['SQLThemes']!="off") {
175 $Settings['SQLThemes'] = "off"; }
176 require_once($SettDir['misc'].'utf8.php');
177 require_once($SettDir['inc'].'filename.php');
178 if(!isset($Settings['use_hashtype'])) {
179 $Settings['use_hashtype'] = "sha1"; }
180 if(!function_exists('hash')||!function_exists('hash_algos')) {
181 if($Settings['use_hashtype']!="md5"&&
182 $Settings['use_hashtype']!="sha1") {
183 $Settings['use_hashtype'] = "sha1"; } }
184 if(function_exists('hash')&&function_exists('hash_algos')) {
185 if(!in_array($Settings['use_hashtype'],hash_algos())) {
186 $Settings['use_hashtype'] = "sha1"; }
187 if($Settings['use_hashtype']!="md2"&&
188 $Settings['use_hashtype']!="md4"&&
189 $Settings['use_hashtype']!="md5"&&
190 $Settings['use_hashtype']!="sha1"&&
191 $Settings['use_hashtype']!="sha224"&&
192 $Settings['use_hashtype']!="sha256"&&
193 $Settings['use_hashtype']!="sha384"&&
194 $Settings['use_hashtype']!="sha512"&&
195 $Settings['use_hashtype']!="ripemd128"&&
196 $Settings['use_hashtype']!="ripemd160"&&
197 $Settings['use_hashtype']!="ripemd256"&&
198 $Settings['use_hashtype']!="ripemd320"&&
199 $Settings['use_hashtype']!="salsa10"&&
200 $Settings['use_hashtype']!="salsa20"&&
201 $Settings['use_hashtype']!="snefru"&&
202 $Settings['use_hashtype']!="snefru256"&&
203 $Settings['use_hashtype']!="gost") {
204 $Settings['use_hashtype'] = "sha1"; } }
205 // Check to see if variables are set
206 require_once($SettDir['misc'].'setcheck.php');
207 $dayconv = array("year" => 29030400, "month" => 2419200, "week" => 604800, "day" => 86400, "hour" => 3600, "minute" => 60, "second" => 1);
208 require_once($SettDir['inc'].'function.php');
209 if($Settings['enable_pathinfo']=="on") {
210 mrstring(); /* Change Path info to Get Vars :P */ }
211 // Check to see if variables are set
212 $qstrhtml = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']);
213 if($Settings['enable_https']=="on"&&$_SERVER['HTTPS']=="on") {
214 if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
215 $HTTPsTest = parse_url($Settings['idburl']); if($HTTPsTest['scheme']=="http") {
216 $Settings['idburl'] = preg_replace("/http\:\/\//i", "https://", $Settings['idburl']); } } }
217 $cookieDomain = null; $cookieSecure = false;
218 if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
219 $URLsTest = parse_url($Settings['idburl']);
220 $cookieDomain = $URLsTest['host'];
221 if($cookieDomain=="localhost") { $cookieDomain = false; }
222 if($Settings['enable_https']=="on") {
223 if($URLsTest['scheme']=="https") { $cookieSecure = true; }
224 if($URLsTest['scheme']!="https") { $cookieSecure = false; } } }
225 if(!in_array("ini_set", $disfunc)) {
226 @ini_set('default_charset', $Settings['charset']); }
227 $File1Name = dirname($_SERVER['SCRIPT_NAME'])."/";
228 $File2Name = $_SERVER['SCRIPT_NAME'];
229 $File3Name=str_replace($File1Name, null, $File2Name);
230 if ($File3Name=="sql.php"||$File3Name=="/sql.php") {
231 header('Location: index.php');
232 exit(); }
233 //error_reporting(E_ERROR);
234 // Check if gzip is on and if user's browser can accept gzip pages
235 if($_GET['act']=="MkCaptcha"||$_GET['act']=="Captcha") {
236 $Settings['use_gzip'] = 'off'; }
237 if($Settings['use_gzip']=="on") {
238 if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")) {
239 $GZipEncode['Type'] = "gzip"; } else {
240 if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "deflate")) {
241 $GZipEncode['Type'] = "deflate"; } else {
242 $Settings['use_gzip'] = "off"; $GZipEncode['Type'] = "none"; } } }
243 if($Settings['use_gzip']=="gzip") {
244 if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")) { $Settings['use_gzip'] = "on";
245 $GZipEncode['Type'] = "gzip"; } else { $Settings['use_gzip'] = "off"; } }
246 if($Settings['use_gzip']=="deflate") {
247 if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "deflate")) { $Settings['use_gzip'] = "on";
248 $GZipEncode['Type'] = "deflate"; } else { $Settings['use_gzip'] = "off"; } }
249 $iWrappers = array(null);
250 function idb_output_handler($buffer) { return $buffer; }
251 function idb_suboutput_handler($buffer) { return $buffer; }
252 if($Settings['clean_ob']=="on") {
253 /* Check for other output handlers/buffers are open
254 and close and get the contents in an array */
255 $numob = count(ob_list_handlers()); $iob = 0;
256 while ($iob < $numob) {
257 $old_ob_var[$iob] = ob_get_clean();
258 ++$iob; } } ob_start("idb_output_handler");
259 if($Settings['use_gzip']=="on") {
260 if($GZipEncode['Type']!="gzip") { if($GZipEncode['Type']!="deflate") { $GZipEncode['Type'] = "gzip"; } }
261 if($GZipEncode['Type']=="gzip") {
262 header("Content-Encoding: gzip"); }
263 if($GZipEncode['Type']=="deflate") {
264 header("Content-Encoding: deflate"); } }
265 /* if(eregi("msie",$browser) && !eregi("opera",$browser)){
266 header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); } */
267 // Some http stuff
268 $SQLStat = sql_connect_db($Settings['sqlhost'],$Settings['sqluser'],$Settings['sqlpass'],$Settings['sqldb']);
269 if(isset($Settings['sql_collate'])&&!isset($Settings['sql_charset'])) {
270 if($Settings['sql_collate']=="ascii_bin"||
271 $Settings['sql_collate']=="ascii_generel_ci") {
272 $Settings['sql_charset'] = "ascii"; }
273 if($Settings['sql_collate']=="latin1_bin"||
274 $Settings['sql_collate']=="latin1_general_ci"||
275 $Settings['sql_collate']=="latin1_general_cs") {
276 $Settings['sql_charset'] = "latin1"; }
277 if($Settings['sql_collate']=="utf8_bin"||
278 $Settings['sql_collate']=="utf8_general_ci"||
279 $Settings['sql_collate']=="utf8_unicode_ci") {
280 $Settings['sql_charset'] = "utf8"; } }
281 if(isset($Settings['sql_collate'])&&isset($Settings['sql_charset'])) {
282 if($Settings['sql_charset']=="ascii") {
283 if($Settings['sql_collate']!="ascii_bin"&&
284 $Settings['sql_collate']!="ascii_generel_ci") {
285 $Settings['sql_collate'] = "ascii_generel_ci"; } }
286 if($Settings['sql_charset']=="latin1") {
287 if($Settings['sql_collate']!="latin1_bin"&&
288 $Settings['sql_collate']!="latin1_general_ci"&&
289 $Settings['sql_collate']!="latin1_general_cs") {
290 $Settings['sql_collate'] = "latin1_general_ci"; } }
291 if($Settings['sql_charset']=="utf8") {
292 if($Settings['sql_collate']!="utf8_bin"&&
293 $Settings['sql_collate']!="utf8_general_ci"&&
294 $Settings['sql_collate']!="utf8_unicode_ci") {
295 $Settings['sql_collate'] = "utf8_unicode_ci"; } }
296 $SQLCollate = $Settings['sql_collate'];
297 $SQLCharset = $Settings['sql_charset']; }
298 if(!isset($Settings['sql_collate'])||!isset($Settings['sql_charset'])) {
299 $SQLCollate = "latin1_general_ci";
300 $SQLCharset = "latin1";
301 if($Settings['charset']=="ISO-8859-1") {
302 $SQLCollate = "latin1_general_ci";
303 $SQLCharset = "latin1"; }
304 if($Settings['charset']=="ISO-8859-15") {
305 $SQLCollate = "latin1_general_ci";
306 $SQLCharset = "latin1"; }
307 if($Settings['charset']=="UTF-8") {
308 $SQLCollate = "utf8_unicode_ci";
309 $SQLCharset = "utf8"; }
310 $Settings['sql_collate'] = $SQLCollate;
311 $Settings['sql_charset'] = $SQLCharset; }
312 sql_set_charset($SQLCharset,$SQLStat);
313 if($SQLStat===false) {
314 header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($peresult);
315 ob_clean(); echo "Sorry could not connect to sql database.\nContact the board admin about error. Error log below.";
316 echo "\n".sql_errorno($SQLStat); $urlstatus = 503;
317 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
318 $sqltable = $Settings['sqltable'];
319 $temp_user_ip = $_SERVER['REMOTE_ADDR'];
320 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
321 $_SERVER['HTTP_USER_AGENT'] = ""; }
322 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") &&
323 !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){
324 header("X-UA-Compatible: IE=Edge"); }
325 if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) {
326 header("X-UA-Compatible: IE=Edge,chrome=1"); }
327 $temp_user_agent = $_SERVER['HTTP_USER_AGENT'];
328 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
329 $MkIndexFile = $exfile['index'].$Settings['file_ext']; }
330 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
331 $MkIndexFile = $exfile['index']; }
332 $temp_session_data = "ViewingPage|s:9:\"?act=view\";ViewingFile|s:".strlen($MkIndexFile).":\"".$MkIndexFile."\";PreViewingTitle|s:7:\"Viewing\";ViewingTitle|s:11:\"Board index\";UserID|s:1:\"0\";UserIP|s:".strlen($_SERVER['REMOTE_ADDR']).":\"".$_SERVER['REMOTE_ADDR']."\";UserGroup|s:".strlen($Settings['GuestGroup']).":\"".$Settings['GuestGroup']."\";UserGroupID|s:1:\"4\";UserTimeZone|s:".strlen($Settings['DefaultTimeZone']).":\"".$Settings['DefaultTimeZone']."\";UserDST|s:".strlen($Settings['DefaultDST']).":\"".$Settings['DefaultDST']."\";";
333 $SQLSType = $Settings['sqltype'];
334 //Session Open Function
335 function sql_session_open($save_path, $session_name ) {
336 global $sess_save_path;
337 $sess_save_path = $save_path;
338 return true; }
339 //Session Close Function
340 $iDBSessCloseDB = true;
341 function sql_session_close() {
342 global $SQLStat,$iDBSessCloseDB;
343 if($iDBSessCloseDB===true) {
344 sql_disconnect_db($SQLStat); }
345 return true; }
346 //Session Read Function
347 function sql_session_read($id) {
348 global $sqltable,$SQLStat,$SQLSType,$temp_user_ip,$temp_user_agent,$temp_session_data;
349 $result = sql_query(sql_pre_query("SELECT * FROM \"".$sqltable."sessions\" WHERE \"session_id\" = '%s'", array($id)),$SQLStat);
350 if (!sql_num_rows($result)) {
351 sql_query(sql_pre_query("DELETE FROM \"".$sqltable."sessions\" WHERE \"session_id\"<>'%s' AND \"ip_address\"='%s' AND \"user_agent\"='%s'", array($id,$temp_user_ip,$temp_user_agent)),$SQLStat);
352 $time = GMTimeStamp();
353 sql_query(sql_pre_query("INSERT INTO \"".$sqltable."sessions\" (\"session_id\", \"session_data\", \"user_agent\", \"ip_address\", \"expires\") VALUES\n".
354 "('%s', '%s', '%s', '%s', %i)", array($id,$temp_session_data,$temp_user_agent,$temp_user_ip,$time)),$SQLStat);
355 return '';
356 } else {
357 $time = GMTimeStamp();
358 $predata = sql_num_rows($result);
359 $data = "";
360 if($predata > 0) {
361 $row = sql_fetch_assoc($result);
362 $data = $row['session_data']; }
363 /*sql_query(sql_pre_query("UPDATE \"".$sqltable."sessions\" SET \"session_data\"='%s',\"expires\"=%i WHERE \"session_id\"='%s'", array($data,$time,$id)),$SQLStat);*/
364 return $data; } }
365 //Session Write Function
366 function sql_session_write($id,$data) {
367 global $sqltable,$SQLStat,$SQLSType,$temp_user_ip,$temp_user_agent;
368 $time = GMTimeStamp();
369 $rs = sql_query(sql_pre_query("UPDATE \"".$sqltable."sessions\" SET \"session_data\"='%s',\"user_agent\"='%s',\"ip_address\"='%s',\"expires\"=%i WHERE \"session_id\"='%s'", array($data,$temp_user_agent,$temp_user_ip,$time,$id)),$SQLStat);
370 return true; }
371 //Session Destroy Function
372 function sql_session_destroy($id) {
373 global $sqltable,$SQLStat;
374 sql_query(sql_pre_query("DELETE FROM \"".$sqltable."sessions\" WHERE \"session_id\" = '$id'", array($id)),$SQLStat);
375 return true; }
376 //Session Garbage Collection Function
377 function sql_session_gc($maxlifetime) {
378 global $sqltable,$SQLStat;
379 $time = GMTimeStamp() - $maxlifetime;
380 //sql_query(sql_pre_query('DELETE FROM \"'.$sqltable.'sessions\" WHERE \"expires\" < UNIX_TIMESTAMP();', array(null)),$SQLStat);
381 sql_query(sql_pre_query("DELETE FROM \"".$sqltable."sessions\" WHERE \"expires\" < %i", array($time)),$SQLStat);
382 return true; }
383 if (session_id()) { session_destroy(); }
384 session_set_save_handler("sql_session_open", "sql_session_close", "sql_session_read", "sql_session_write", "sql_session_destroy", "sql_session_gc");
385 if($cookieDomain==null) {
386 session_set_cookie_params(0, $cbasedir); }
387 if($cookieDomain!=null) {
388 if($cookieSecure===true) {
389 session_set_cookie_params(0, $cbasedir, $cookieDomain, 1); }
390 if($cookieSecure===false) {
391 session_set_cookie_params(0, $cbasedir, $cookieDomain); } }
392 session_cache_limiter("private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
393 header("Cache-Control: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
394 header("Pragma: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
395 header("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
396 header("Date: ".gmdate("D, d M Y H:i:s")." GMT");
397 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
398 header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
399 if(!isset($_COOKIE[$Settings['sqltable']."sess"])) {
400 $exptime = GMTimeStamp() - ini_get("session.gc_maxlifetime");
401 sql_query(sql_pre_query("DELETE FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" < %i OR \"ip_address\"='%s' AND \"user_agent\"='%s'", array($exptime,$temp_user_ip,$temp_user_agent)),$SQLStat); }
402 if(!isset($_SESSION['CheckCookie'])) {
403 if(isset($_COOKIE['SessPass'])&&isset($_COOKIE['MemberName'])) {
404 session_set_save_handler("sql_session_open", "sql_session_close", "sql_session_read", "sql_session_write", "sql_session_destroy", "sql_session_gc");
405 session_name($Settings['sqltable']."sess");
406 session_start();
407 if(!isset($_SESSION['UserFormID'])) { $_SESSION['UserFormID'] = null; }
408 $iDBSessCloseDB = false;
409 $_SESSION['ShowActHidden'] = "no";
410 output_reset_rewrite_vars();
411 require($SettDir['inc'].'prelogin.php');
412 session_write_close(); } }
413 session_set_save_handler("sql_session_open", "sql_session_close", "sql_session_read", "sql_session_write", "sql_session_destroy", "sql_session_gc");
414 session_name($Settings['sqltable']."sess");
415 session_start();
416 if(!isset($_SESSION['UserFormID'])) { $_SESSION['UserFormID'] = null; }
417 $iDBSessCloseDB = true;
418 output_reset_rewrite_vars();
419 //@register_shutdown_function("session_write_close");
420 //header("Set-Cookie: PHPSESSID=" . session_id() . "; path=".$cbasedir);
421 if(!in_array("ini_set", $disfunc)) {
422 // Set user agent if we can use ini_set and have to do any http requests. :P
423 $iverstring = "FR 0.0.0 ".$VER2[2]." 0";
424 if($Settings['hideverinfohttp']=="off") {
425 $iverstring = $VER2[1]." ".$VER1[0].".".$VER1[1].".".$VER1[2]." ".$VER2[2]." ".$SubVerN; }
426 if($Settings['hideverinfohttp']=="on") {
427 $iverstring = "FR 0.0.0 ".$VER2[2]." 0"; }
428 $qstrtest = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']);
429 $qseptest = htmlentities($Settings['qsep'], ENT_QUOTES, $Settings['charset']);
430 $isiteurl = $Settings['idburl'].url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
431 @ini_set("user_agent", "Mozilla/5.0 (compatible; ".$VerCheckName."/".$iverstring."; +".$isiteurl.")");
432 if (function_exists("stream_context_create")) {
433 $iopts = array(
434 'http' => array(
435 'method' => "GET",
436 'header' => "Accept-Language: *\r\n".
437 "User-Agent: Mozilla/5.0 (compatible; ".$VerCheckName."/".$iverstring."; +".$isiteurl.")\r\n".
438 "Accept: */*\r\n".
439 "Connection: keep-alive\r\n".
440 "Referer: ".$isiteurl."\r\n".
441 "From: ".$isiteurl."\r\n".
442 "Via: ".$_SERVER['REMOTE_ADDR']."\r\n".
443 "Forwarded: ".$_SERVER['REMOTE_ADDR']."\r\n".
444 "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR']."\r\n".
445 "Client-IP: ".$_SERVER['REMOTE_ADDR']."\r\n"
448 $icontext = stream_context_create($iopts);
449 function file_get_contents_alt($filename,$use_include_path=null,$offset=-1,$maxlen=null) {
450 global $icontext;
451 if($maxlen!==null) {
452 return file_get_contents($filename,$use_include_path,$icontext,$offset,$maxlen); }
453 if($maxlen===null) {
454 return file_get_contents($filename,$use_include_path,$icontext,$offset); } } } }
455 $iDBVerName = $VerCheckName."|".$VER2[1]."|".$VER1[0].".".$VER1[1].".".$VER1[2]."|".$VER2[2]."|".$SubVerN;
457 This way checks iDB version by sending the iDBVerName to the iDB Version Checker.
458 $Settings['vercheck'] = 1;
459 This way checks iDB version by sending the board url to the iDB Version Checker.
460 $Settings['vercheck'] = 2;
462 if(!isset($Settings['vercheck'])) {
463 $Settings['vercheck'] = 2; }
464 if($Settings['vercheck']!=1&&
465 $Settings['vercheck']!=2) {
466 $Settings['vercheck'] = 2; }
467 if($Settings['vercheck']===2) {
468 if($_GET['act']=="vercheckxsl") {
469 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
470 header("Content-Type: application/xml; charset=".$Settings['charset']); }
471 else { header("Content-Type: text/xml; charset=".$Settings['charset']); }
472 xml_doc_start("1.0",$Settings['charset']);
473 echo "\n"; ?>
474 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
476 <xsl:template match="/">
477 <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
478 <body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
479 <xsl:for-each select="versioninfo/version">
480 <div style="background-color:teal;color:white;padding:4px">
481 <span style="font-weight:bold"><xsl:value-of select="vname"/></span>
482 </div>
483 <div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
484 <span style="font-style:italic">
485 Board Name: <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><xsl:value-of select="title"/></a></span>
486 </div>
487 </xsl:for-each>
488 </body>
489 </html>
490 </xsl:template>
492 </xsl:stylesheet>
493 <?php gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
494 if($_GET['act']=="versioninfo") {
495 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
496 header("Content-Type: application/xml; charset=".$Settings['charset']); }
497 else { header("Content-Type: text/xml; charset=".$Settings['charset']); }
498 xml_doc_start("1.0",$Settings['charset']);
499 echo '<?xml-stylesheet type="text/xsl" href="'.url_maker($exfile['index'],$Settings['file_ext'],"act=vercheckxsl",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']).'"?>'."\n"; ?>
501 <!DOCTYPE versioninfo [
502 <!ELEMENT versioninfo (version*)>
503 <!ELEMENT version (charset,title,name,vname)>
504 <!ELEMENT charset (#PCDATA)>
505 <!ELEMENT title (#PCDATA)>
506 <!ELEMENT name (#PCDATA)>
507 <!ELEMENT vname (#PCDATA)>
510 <versioninfo>
512 <version>
513 <charset><?php echo $Settings['charset']; ?></charset>
514 <title><?php echo $Settings['board_name']; ?></title>
515 <?php echo "<name>".$iDBVerName."</name>\n"; ?>
516 <vname><?php echo $VerCheckName; ?> Version Checker</vname>
517 </version>
519 </versioninfo>
520 <?php gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
521 if($Settings['vercheck']===1) {
522 if($_GET['act']=="versioninfo") { header("Content-Type: text/plain; charset=UTF-8");
523 header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName)); $urlstatus = 302;
524 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
525 if($_GET['act']=="homepage") { header("Content-Type: text/plain; charset=UTF-8");
526 header("Location: ".$Settings['weburl']); $urlstatus = 302;
527 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
528 if($_GET['act']=="bsdl"||$_GET['act']=="BSDL"||$_GET['act']=="license"||
529 $_GET['act']=="LICENSE"||$_GET['act']=="License") { $_GET['act']="bsd"; }
530 if($_GET['act']=="bsd") {
531 header("Content-Type: text/plain; charset=".$Settings['charset']);
532 require("LICENSE"); gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
533 if($_GET['act']=="README"||$_GET['act']=="ReadME") { $_GET['act']="readme"; }
534 if($_GET['act']=="readme"||$_GET['act']=="ReadMe") {
535 header("Content-Type: text/plain; charset=".$Settings['charset']);
536 require("README"); gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
537 if($_GET['act']=="js"||$_GET['act']=="javascript") {
538 header("Content-Script-Type: text/javascript");
539 if(stristr($_SERVER["HTTP_ACCEPT"],"application/x-javascript") ) {
540 header("Content-Type: application/x-javascript; charset=".$Settings['charset']); } else {
541 if(stristr($_SERVER["HTTP_ACCEPT"],"application/javascript") ) {
542 header("Content-Type: application/javascript; charset=".$Settings['charset']); } else {
543 header("Content-Type: text/javascript; charset=".$Settings['charset']); } }
544 require($SettDir['inc'].'javascript.php');
545 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
546 if($Settings['use_captcha']=="on") {
547 if($_GET['act']=="MkCaptcha"||$_GET['act']=="Captcha") {
548 if($Settings['captcha_clean']=="on") { ob_clean(); }
549 require($SettDir['inc']."captcha.php");
550 $aFonts = array('inc/fonts/VeraBd.ttf', 'inc/fonts/VeraBI.ttf', 'inc/fonts/VeraIt.ttf', 'inc/fonts/Vera.ttf');
551 $oPhpCaptcha = new PhpCaptcha($aFonts, 200, 60);
552 $RNumSize = rand(7,17); $i=0; $RandNum = null;
553 while ($i <= $RNumSize) {
554 $RandNum=$RandNum.dechex(rand(1,15)); ++$i; }
555 $RandNum=strtoupper($RandNum);
556 $oPhpCaptcha->SetOwnerText("Fake Code: ".$RandNum);
557 $oPhpCaptcha->UseColour(true);
558 $oPhpCaptcha->Create(); session_write_close(); die(); } }
559 require($SettDir['inc'].'groupsetup.php');
560 if($Settings['board_offline']=="on"&&$GroupInfo['CanViewOffLine']!="yes") {
561 header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($peresult);
562 ob_clean(); if(!isset($Settings['offline_text'])) {
563 echo "Sorry the board is off line.\nIf you are a admin you can login by the admin cp."; }
564 if(isset($Settings['offline_text'])) { echo $Settings['offline_text']; } $urlstatus = 503;
565 //echo "\n".sql_errorno($SQLStat);
566 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
567 //Time Zone Set
568 if(!isset($_SESSION['UserTimeZone'])) {
569 if(isset($Settings['DefaultTimeZone'])) {
570 $_SESSION['UserTimeZone'] = $Settings['DefaultTimeZone'];
571 if(!isset($Settings['DefaultTimeZone'])) {
572 $_SESSION['UserTimeZone'] = SeverOffSet().":00"; } } }
573 $checktime = explode(":",$_SESSION['UserTimeZone']);
574 if(count($checktime)!=2) {
575 if(!isset($checktime[0])) { $checktime[0] = "0"; }
576 if(!isset($checktime[1])) { $checktime[1] = "00"; }
577 $_SESSION['UserTimeZone'] = $checktime[0].":".$checktime[1]; }
578 if(!is_numeric($checktime[0])) { $checktime[0] = "0"; }
579 if(!is_numeric($checktime[1])) { $checktime[1] = "00"; }
580 if($checktime[1]<0) { $checktime[1] = "00"; $_SESSION['UserTimeZone'] = $checktime[0].":".$checktime[1]; }
581 $checktimea = array("offset" => $_SESSION['UserTimeZone'], "hour" => $checktime[0], "minute" => $checktime[1]);
582 if(!isset($_SESSION['UserDST'])) { $_SESSION['UserDST'] = null; }
583 if($_SESSION['UserDST']==null) {
584 if($Settings['DefaultDST']=="off") {
585 $_SESSION['UserDST'] = "off"; }
586 if($Settings['DefaultDST']=="on") {
587 $_SESSION['UserDST'] = "on"; } }
588 // Guest Stuff
589 if(isset($_SESSION['MemberName'])||
590 isset($_COOKIE['MemberName'])) {
591 $_SESSION['GuestName'] = null;
592 $_COOKIE['GuestName'] = null; }
593 if(!isset($_SESSION['MemberName'])&&!isset($_COOKIE['MemberName'])) {
594 if(!isset($_SESSION['GuestName'])&&isset($_COOKIE['GuestName'])) {
595 $_SESSION['GuestName'] = $_COOKIE['GuestName']; } }
596 if(!isset($_SESSION['LastPostTime'])) { $_SESSION['LastPostTime'] = "0"; }
597 // Skin Stuff
598 if(!isset($_SESSION['Theme'])) { $_SESSION['Theme'] = null; }
599 if(!isset($_GET['theme'])) { $_GET['theme'] = null; }
600 if(!isset($_POST['theme'])) { $_POST['theme'] = null; }
601 if(!isset($_GET['skin'])) { $_GET['skin'] = null; }
602 if(!isset($_POST['skin'])) { $_POST['skin'] = null; }
603 if(!isset($_GET['style'])) { $_GET['style'] = null; }
604 if(!isset($_POST['style'])) { $_POST['style'] = null; }
605 if(!isset($_GET['css'])) { $_GET['css'] = null; }
606 if(!isset($_POST['css'])) { $_POST['css'] = null; }
607 if($_GET['theme']==null) {
608 if($_POST['theme']!=null) {
609 $_GET['theme'] = $_POST['theme']; }
610 if($_POST['skin']!=null) {
611 $_GET['theme'] = $_POST['skin']; }
612 if($_POST['style']!=null) {
613 $_GET['theme'] = $_POST['style']; }
614 if($_POST['css']!=null) {
615 $_GET['theme'] = $_POST['css']; }
616 if($_GET['skin']!=null) {
617 $_GET['theme'] = $_GET['skin']; }
618 if($_GET['style']!=null) {
619 $_GET['theme'] = $_GET['style']; }
620 if($_GET['css']!=null) {
621 $_GET['theme'] = $_GET['css']; } }
622 if($Settings['SQLThemes']=="off") {
623 if($_GET['theme']!=null) {
624 $_GET['theme'] = chack_themes($_GET['theme']);
625 if($_GET['theme']=="../"||$_GET['theme']=="./") {
626 $_GET['theme']=$Settings['DefaultTheme']; $_SESSION['Theme']=$Settings['DefaultTheme']; }
627 if (file_exists($SettDir['themes'].$_GET['theme']."/settings.php")) {
628 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
629 $NewDay=GMTimeStamp();
630 $qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_GET['theme'],$NewDay,$_SESSION['UserID']));
631 sql_query($qnewskin,$SQLStat); }
632 /* The file Theme Exists */ }
633 else { $_GET['theme'] = $Settings['DefaultTheme'];
634 $_SESSION['Theme'] = $Settings['DefaultTheme'];
635 /* The file Theme Dose Not Exists */ } }
636 if($_GET['theme']==null) {
637 if($_SESSION['Theme']!=null) {
638 $OldTheme = $_SESSION['Theme'];
639 $_SESSION['Theme'] = chack_themes($_SESSION['Theme']);
640 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
641 if($OldTheme!=$_SESSION['Theme']) {
642 $NewDay=GMTimeStamp();
643 $qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_SESSION['Theme'],$NewDay,$_SESSION['UserID']));
644 sql_query($qnewskin,$SQLStat); } }
645 $_GET['theme']=$_SESSION['Theme']; }
646 if($_SESSION['Theme']==null) {
647 $_SESSION['Theme']=$Settings['DefaultTheme'];
648 $_GET['theme']=$Settings['DefaultTheme']; } }
649 $PreSkin['skindir1'] = $_SESSION['Theme'];
650 $PreSkin['skindir2'] = $SettDir['themes'].$_SESSION['Theme'];
651 require($SettDir['themes'].$_GET['theme']."/settings.php"); }
652 if($Settings['SQLThemes']=="on") {
653 if($_GET['theme']==null&&$_SESSION['Theme']==null) {
654 $_GET['theme'] = $Settings['DefaultTheme'];
655 $_SESSION['Theme'] = $Settings['DefaultTheme']; }
656 if($_GET['theme']!=null) {
657 $themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_GET['theme'])); }
658 if($_GET['theme']==null) {
659 if($_SESSION['Theme']!=null) {
660 $themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_SESSION['Theme'])); } }
661 $themeresult=sql_query($themequery,$SQLStat);
662 $themenum=sql_num_rows($themeresult);
663 if($themenum<=0) {
664 $_GET['theme'] = $Settings['DefaultTheme'];
665 $_SESSION['Theme'] = $Settings['DefaultTheme'];
666 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
667 $NewDay=GMTimeStamp();
668 $qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_SESSION['Theme'],$NewDay,$_SESSION['UserID']));
669 sql_query($qnewskin,$SQLStat); }
670 $themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_GET['theme']));
671 $themeresult=sql_query($themequery,$SQLStat);
672 $themenum=sql_num_rows($themeresult); }
673 else {
674 if($_GET['theme']==null) {
675 if($_SESSION['Theme']!=null) {
676 $_GET['theme'] = $_SESSION['Theme']; } }
677 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
678 $NewDay=GMTimeStamp();
679 $qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_GET['theme'],$NewDay,$_SESSION['UserID']));
680 sql_query($qnewskin,$SQLStat); } }
681 require($SettDir['inc'].'sqlthemes.php');
682 sql_free_result($themeresult); }
683 $_SESSION['Theme'] = $_GET['theme'];
684 function get_theme_values($matches) {
685 global $ThemeSet;
686 $return_text = null;
687 if(isset($ThemeSet[$matches[1]])) { $return_text = $ThemeSet[$matches[1]]; }
688 if(!isset($ThemeSet[$matches[1]])) { $return_text = null; }
689 return $return_text; }
690 foreach($ThemeSet AS $key => $value) {
691 $ThemeSet[$key] = preg_replace("/%%/s", "{percent}p", $ThemeSet[$key]);
692 $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}T/s", "get_theme_values", $ThemeSet[$key]);
693 $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}e/s", "get_env_values", $ThemeSet[$key]);
694 $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}i/s", "get_server_values", $ThemeSet[$key]);
695 $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}s/s", "get_setting_values", $ThemeSet[$key]);
696 $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}t/s", "get_time", $ThemeSet[$key]);
697 $ThemeSet[$key] = preg_replace("/\{percent\}p/s", "%", $ThemeSet[$key]); }
698 if(!isset($ThemeSet['TableStyle'])) {
699 $ThemeSet['TableStyle'] = "table"; }
700 if(isset($ThemeSet['TableStyle'])) {
701 if($ThemeSet['TableStyle']!="div"&&
702 $ThemeSet['TableStyle']!="table") {
703 $ThemeSet['TableStyle'] = "table"; } }
704 if(!isset($_SESSION['DBName'])) { $_SESSION['DBName'] = null; }
705 if($_SESSION['DBName']==null) {
706 $_SESSION['DBName'] = $Settings['sqldb']; }
707 if($_SESSION['DBName']!=null) {
708 if($_SESSION['DBName']!=$Settings['sqldb']) {
709 redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false)); } }