OSDN Git Service

Added more support for PostgreSQL.
[idb/iDB.git.git] / inc / misc / setcheck.php
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.
5
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.
10
11     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: setcheck.php - Last Update: 12/10/2009 SVN 386 - Author: cooldude2k $
15 */
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="setcheck.php"||$File3Name=="/setcheck.php") {
18         require('index.php');
19         exit(); }
20 if(!isset($Settings['showverinfo'])) { $Settings['showverinfo'] = "on"; }
21 if(!isset($_GET['debug'])) { $_GET['debug'] = false; }
22 if(!isset($GZipEncode)) { $GZipEncode = array("Type" => "none"); }
23 if(!is_array($GZipEncode)) { $GZipEncode = array("Type" => "none"); }
24 if(!isset($preact)) { $preact = null; }
25 if(!isset($Settings['hash_type'])) { $Settings['hash_type'] = null; }
26 if(!isset($Error)) { $Error = null; }
27 if(!isset($passright)) { $passright = null; }
28 $SQLimit = null;
29 if(!isset($Settings['sqltype'])) {
30         $Settings['sqltype'] = "mysql"; }
31 $Settings['sqltype'] = strtolower($Settings['sqltype']);
32 if($Settings['sqltype']!="mysql"&&
33         $Settings['sqltype']!="pgsql") {
34         $Settings['sqltype'] = "mysql"; }
35 if($Settings['sqltype']=="mysql") {
36         $SQLimit = "LIMIT %i,%i"; }
37 if($Settings['sqltype']=="pgsql") {
38         $SQLimit = "OFFSET %i LIMIT %i"; }
39 if(!isset($Settings['enable_pathinfo'])) {
40   $Settings['enable_pathinfo'] = "off";  }
41 if($Settings['enable_pathinfo']!="on"&&
42         $Settings['enable_pathinfo']!="off") {
43   $Settings['enable_pathinfo'] = "off";  }
44 $Settings['sessionid_in_urls'] = "off";
45 if(!isset($Settings['sessionid_in_urls'])) {
46   $Settings['sessionid_in_urls'] = "off";  }
47 if($Settings['sessionid_in_urls']!="on"&&
48         $Settings['sessionid_in_urls']!="off") {
49   $Settings['sessionid_in_urls'] = "off";  }
50 if(!isset($Settings['use_captcha'])) {
51         $Settings['use_captcha'] = "on"; }
52 if(isset($Settings['use_captcha'])) {
53         if($Settings['use_captcha']!="on"&&
54                 $Settings['use_captcha']!="off") {
55         $Settings['use_captcha'] = "on"; } }
56 if(!isset($Settings['captcha_guest'])) {
57         $Settings['captcha_guest'] = "on"; }
58 if(isset($Settings['captcha_guest'])) {
59         if($Settings['captcha_guest']!="on"&&
60                 $Settings['captcha_guest']!="off") {
61         $Settings['captcha_guest'] = "on"; } }
62 if(!isset($Settings['captcha_clean'])) {
63         $Settings['captcha_clean'] = "off"; }
64 if(isset($Settings['captcha_clean'])) {
65         if($Settings['captcha_clean']!="on"&&
66                 $Settings['captcha_clean']!="off") {
67         $Settings['captcha_clean'] = "on"; } }
68 $sidurls = $Settings['sessionid_in_urls'];
69 if(!isset($Settings['board_offline'])) {
70   $Settings['board_offline'] = "off";  }
71 if($Settings['board_offline']!="on"&&
72         $Settings['board_offline']!="off") {
73   $Settings['board_offline'] = "off";  }
74 $oldusername = null; $oldtopicname = null; $ext = null;
75 if($Settings['DefaultTheme']==null) {
76         $Settings['DefaultTheme'] = "iDB"; }
77 if($Settings['DefaultTimeZone']==null) {
78         $Settings['DefaultTimeZone'] = SeverOffSet(null); }
79 if($Settings['DefaultDST']!="on"&&
80         $Settings['DefaultDST']!="off") { 
81         $Settings['DefaultDST'] = "off"; }
82 if(!isset($Settings['use_captcha'])) {
83         $Settings['use_captcha'] = "off"; }
84 if($Settings['use_captcha']!="on"&&
85         $Settings['use_captcha']!="off") { 
86         $Settings['use_captcha'] = "off"; }
87 if(!isset($Settings['captcha_clean'])) {
88         $Settings['captcha_clean'] = "off"; }
89 if($Settings['captcha_clean']!="on"&&
90         $Settings['captcha_clean']!="off") { 
91         $Settings['captcha_clean'] = "off"; }
92 if($Settings['enable_rss']!="on"&&
93         $Settings['enable_rss']!="on") { 
94         $Settings['enable_rss'] = "off"; }
95 if($Settings['enable_rss']=="on") { 
96     $Settings['enable_rss'] = "on"; }
97 if (file_exists("themes/iDB/settings.php")) {
98         $FallBack['DefaultTheme'] = "iDB"; }
99 if (!file_exists("themes/iDB/settings.php")) {
100         $FallBack['DefaultTheme'] = "Gray"; }
101 if($Settings['DefaultTheme']!=null) {
102 if (file_exists("themes/".$Settings['DefaultTheme']."/settings.php")) {
103 /* The file Skin Exists */ }
104 else { $Settings['DefaultTheme']=$FallBack['DefaultTheme'];
105 /* The file Skin Dose Not Exists */ } }
106 if($Settings['TestReferer']!="on"&&
107         $Settings['TestReferer']!="off") {
108         $Settings['TestReferer'] = "off"; }
109 if($Settings['charset']==null) {
110         $Settings['charset'] = "iso-8859-15"; }
111 if($Settings['qstr']==null) {
112         $Settings['qstr'] = "&"; }
113 if($Settings['qsep']==null) {
114         $Settings['qsep'] = "="; }
115 if($Settings['qsep']=="#"||
116         $Settings['qstr']=="#") {
117         $Settings['qstr'] = "&";
118         $Settings['qsep'] = "="; }
119 if($Settings['qsep']==$Settings['qstr']) {
120         $Settings['qstr'] = "&";
121         $Settings['qsep'] = "="; }
122 if($Settings['qstr']=="/"||
123         $Settings['qstr']=="&") {
124         $Settings['qsep'] = "="; }
125 if($Settings['qstr']!="&"&&
126         $Settings['qstr']!="/") {
127 qstring($Settings['qstr'],$Settings['qsep']);
128 if(!isset($_GET['page'])) { $_GET['page'] = null; }
129 if(!isset($_GET['act'])) { $_GET['act'] = null; }
130 if(!isset($_POST['act'])) { $_POST['act'] = null; }
131 if(!isset($_GET['id'])) { $_GET['id'] = null; } 
132 if(!isset($_GET['debug'])) { $_GET['debug'] = "false"; }
133 if(!isset($_GET['post'])) { $_GET['post'] = null; }
134 if(!isset($_POST['License'])) { $_POST['License'] = null; } }
135 if(!isset($Settings['enable_https'])) {
136   $Settings['enable_https'] = "off";  }
137 if($Settings['enable_https']!="on"&&
138         $Settings['enable_https']!="off") {
139   $Settings['enable_https'] = "off";  }
140 if(!isset($Settings['file_ext'])||
141         $Settings['file_ext']==null) {
142         $Settings['file_ext'] = ".php"; }
143 if(!isset($Settings['rss_ext'])||
144         $Settings['rss_ext']==null) {
145         $Settings['rss_ext'] = ".php"; }
146 if(!isset($Settings['js_ext'])||
147         $Settings['js_ext']==null) {
148         $Settings['js_ext'] = ".js"; }
149 if(!isset($Settings['add_power_by'])) {
150   $Settings['add_power_by'] = "off";  }
151 if($Settings['add_power_by']=="on") {
152 $idbpowertitle = " (Powered by ".$iDB.")";
153 $itbpowertitle = " (Powered by ".$iTB.")"; }
154 if($Settings['add_power_by']!="on") {
155 $idbpowertitle = null;
156 $itbpowertitle = null; }
157 if($Settings['GuestGroup']==null) {
158         $Settings['GuestGroup'] = "Guest"; }
159 if($Settings['MemberGroup']==null) {
160         $Settings['MemberGroup'] = "Member"; }
161 if($Settings['ValidateGroup']==null&&
162         $Settings['AdminValidate']=="on") {
163 $Settings['ValidateGroup'] = "Validate"; }
164 if($Settings['html_type']=="html4") { 
165         $Settings['html_type'] = "html10"; }
166 /*if($_GET['debug']!="off"||$_GET['debug']=="on") {
167         output_add_rewrite_var("amp;debug",$_GET['debug']); }*/
168 if (!isset($_GET['action'])) { $_GET['action'] = null; }
169 if (!isset($_GET['activity'])) { $_GET['activity'] = null; }
170 if (!isset($_GET['function'])) { $_GET['function'] = null; }
171 if (!isset($_GET['mode'])) { $_GET['mode'] = null; }
172 if (!isset($_GET['show'])) { $_GET['show'] = null; }
173 if (!isset($_GET['do'])) { $_GET['do'] = null; }
174 if ($_GET['act']==null&&$_GET['action']!=null) { $_GET['act']=$_GET['action']; }
175 if ($_GET['act']==null&&$_GET['activity']!=null) { $_GET['act']=$_GET['activity']; }
176 if ($_GET['act']==null&&$_GET['function']!=null) { $_GET['act']=$_GET['function']; }
177 if ($_GET['act']==null&&$_GET['mode']!=null) { $_GET['act']=$_GET['mode']; }
178 if ($_GET['act']==null&&$_GET['show']!=null) { $_GET['act']=$_GET['show']; }
179 if ($_GET['act']==null&&$_GET['do']!=null) { $_GET['act']=$_GET['do']; }
180 if ($_GET['act']=="idx"||$_GET['act']=="View") { $_GET['act']="view"; }
181 if ($_GET['act']=="Lo-Fi"||$_GET['act']=="lo-fi") { $_GET['act']="lowview"; }
182 if ($_GET['act']=="Low-View"||$_GET['act']=="low-view") { $_GET['act']="lowview"; }
183 if ($_GET['act']=="LowView"||$_GET['act']=="loview") { $_GET['act']="lowview"; }
184 if ($_GET['act']=="iDBInfo") { header('Location: http://sourceforge.net/projects/intdb/'); }
185 if ($_GET['act']=="iDBSite") { header('Location: http://intdb.sourceforge.net/'); }
186 if ($_GET['act']=="OldiDBInfo") { header('Location: http://developer.berlios.de/projects/idb/'); }
187 if ($_GET['act']=="OldiDBSite") { header('Location: http://idb.berlios.de/'); }
188 if ($_GET['act']=="DF2kInfo") { header('Location: http://developer.berlios.de/projects/df2k/'); }
189 if ($_GET['act']=="DF2kSite") { header('Location: http://df2k.berlios.de/'); }
190 if ($_GET['act']=="GM2kSite") { header('Location: http://upload.idb.s1.jcink.com/'); }
191 ?>