Small update to Installer and AdminCP.
[iDB.git] / setup / mkconfig.php
bloba6ed29d8e3d5b2bd5dfe5975494724d58d13efaa
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-2010 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
13 iDB Installer made by Game Maker 2k - http://idb.berlios.net/
15 $FileInfo: mkconfig.php - Last Update: 09/15/2010 SVN 546 - Author: cooldude2k $
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="mkconfig.php"||$File3Name=="/mkconfig.php") {
19 require('index.php');
20 exit(); }
21 require_once('settings.php');
22 if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
23 if(!isset($SetupDir['sql'])) { $SetupDir['sql'] = "setup/sql/"; }
24 if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
25 $_POST['DatabaseHost'] = $Settings['sqlhost'];
26 $_POST['DatabaseUserName'] = $Settings['sqluser'];
27 $_POST['DatabasePassword'] = $Settings['sqlpass'];
28 $Settings['charset'] = $_POST['charset'];
29 $Settings['sqltype'] = $_POST['DatabaseType'];
30 if(!isset($_POST['DefaultTheme'])) { $_POST['DefaultTheme'] = "iDB"; }
31 if(isset($_POST['DefaultTheme'])) {
32 $_POST['DefaultTheme'] = chack_themes($_POST['DefaultTheme']); }
33 $Settings['vercheck'] = 2;
34 if(!isset($_POST['SQLThemes'])) { $_POST['SQLThemes'] = "off"; }
35 if($_POST['SQLThemes']!="on"&&$_POST['SQLThemes']!="off") {
36 $_POST['SQLThemes'] = "off"; }
37 if(function_exists("date_default_timezone_set")) {
38 @date_default_timezone_set("UTC"); }
40 <tr class="TableRow3" style="text-align: center;">
41 <td class="TableColumn3" colspan="2">
42 <?php
43 $dayconv = array('second' => 1, 'minute' => 60, 'hour' => 3600, 'day' => 86400, 'week' => 604800, 'month' => 2630880, 'year' => 31570560, 'decade' => 315705600);
44 $_POST['tableprefix'] = strtolower($_POST['tableprefix']);
45 $_POST['tableprefix'] = preg_replace("/[^A-Za-z0-9_$]/", "", $_POST['tableprefix']);
46 if($_POST['tableprefix']==null||$_POST['tableprefix']=="_") { $_POST['tableprefix']="idb_"; }
47 if($_POST['sessprefix']==null||$_POST['sessprefix']=="_") { $_POST['sessprefix']="idb_"; }
48 $checkfile="settings.php";
49 @chmod("settings.php",0766);
50 @chmod("settingsbak.php",0766);
51 if (!is_writable($checkfile)) {
52 echo "<br />Settings is not writable.";
53 @chmod("settings.php",0766); $Error="Yes";
54 @chmod("settingsbak.php",0766);
55 } else { /* settings.php is writable install iDB. ^_^ */ }
56 session_name($_POST['tableprefix']."sess");
57 if(preg_match("/\/$/", $_POST['BoardURL'])<1) {
58 $_POST['BoardURL'] = $_POST['BoardURL']."/"; }
59 $URLsTest = parse_url($_POST['BoardURL']);
60 $this_dir = $URLsTest['path'];
61 session_set_cookie_params(0, $this_dir, $URLsTest['host']);
62 session_cache_limiter("private, must-revalidate");
63 header("Cache-Control: private, must-revalidate"); // IE 6 Fix
64 header("Pragma: private, must-revalidate");
65 header("Date: ".gmdate("D, d M Y H:i:s")." GMT");
66 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
67 header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
68 session_start();
69 if (pre_strlen($_POST['AdminPasswords'])<"3") { $Error="Yes";
70 echo "<br />Your password is too small."; }
71 if (pre_strlen($_POST['AdminUser'])<"3") { $Error="Yes";
72 echo "<br />Your user name is too small."; }
73 if (pre_strlen($_POST['AdminUser'])<"3") { $Error="Yes";
74 echo "<br />Your user name is too small."; }
75 if (pre_strlen($_POST['AdminEmail'])<"3") { $Error="Yes";
76 echo "<br />Your email name is too small."; }
77 if (pre_strlen($_POST['AdminPasswords'])>"60") { $Error="Yes";
78 echo "<br />Your password is too big."; }
79 if (pre_strlen($_POST['AdminUser'])>"30") { $Error="Yes";
80 echo "<br />Your user name is too big."; }
81 if ($_POST['AdminPasswords']!=$_POST['ReaPassword']) { $Error="Yes";
82 echo "<br />Your passwords did not match."; }
83 if($_POST['HTMLType']=="xhtml11") { $_POST['HTMLLevel'] = "Strict"; }
84 if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
85 $_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['charset']);
86 $_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
87 $_POST['BoardURL'] = addslashes($_POST['BoardURL']);
88 $YourDate = GMTimeStamp();
89 $YourEditDate = $YourDate + $dayconv['minute'];
90 $GSalt = salt_hmac(); $YourSalt = salt_hmac();
91 /* Fix The User Info for iDB */
92 $_POST['NewBoardName'] = stripcslashes(htmlspecialchars($_POST['NewBoardName'], ENT_QUOTES, $Settings['charset']));
93 //$_POST['NewBoardName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NewBoardName']);
94 $_POST['NewBoardName'] = remove_spaces($_POST['NewBoardName']);
95 //$_POST['AdminPassword'] = stripcslashes(htmlspecialchars($_POST['AdminPassword'], ENT_QUOTES, $Settings['charset']));
96 //$_POST['AdminPassword'] = preg_replace("/\&amp;#(.*?);/is", "&#$1;", $_POST['AdminPassword']);
97 $_POST['AdminUser'] = stripcslashes(htmlspecialchars($_POST['AdminUser'], ENT_QUOTES, $Settings['charset']));
98 //$_POST['AdminUser'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['AdminUser']);
99 $_POST['AdminUser'] = remove_spaces($_POST['AdminUser']);
100 $_POST['AdminEmail'] = remove_spaces($_POST['AdminEmail']);
101 if(!function_exists('hash')&&!function_exists('hash_algos')) {
102 if($_POST['usehashtype']!="md5"&&
103 $_POST['usehashtype']!="sha1") {
104 $_POST['usehashtype'] = "sha1"; } }
105 if(function_exists('hash')&&function_exists('hash_algos')) {
106 if(!in_array($_POST['usehashtype'],hash_algos())) {
107 $_POST['usehashtype'] = "sha1"; }
108 if($_POST['usehashtype']!="md2"&&
109 $_POST['usehashtype']!="md4"&&
110 $_POST['usehashtype']!="md5"&&
111 $_POST['usehashtype']!="sha1"&&
112 $_POST['usehashtype']!="sha224"&&
113 $_POST['usehashtype']!="sha256"&&
114 $_POST['usehashtype']!="sha384"&&
115 $_POST['usehashtype']!="sha512"&&
116 $_POST['usehashtype']!="ripemd128"&&
117 $_POST['usehashtype']!="ripemd160"&&
118 $_POST['usehashtype']!="ripemd256"&&
119 $_POST['usehashtype']!="ripemd320") {
120 $_POST['usehashtype'] = "sha1"; } }
121 if($_POST['usehashtype']=="md2") { $iDBHashType = "iDBH2"; }
122 if($_POST['usehashtype']=="md4") { $iDBHashType = "iDBH4"; }
123 if($_POST['usehashtype']=="md5") { $iDBHashType = "iDBH5"; }
124 if($_POST['usehashtype']=="sha1") { $iDBHashType = "iDBH"; }
125 if($_POST['usehashtype']=="sha224") { $iDBHashType = "iDBH224"; }
126 if($_POST['usehashtype']=="sha256") { $iDBHashType = "iDBH256"; }
127 if($_POST['usehashtype']=="sha384") { $iDBHashType = "iDBH384"; }
128 if($_POST['usehashtype']=="sha512") { $iDBHashType = "iDBH512"; }
129 if($_POST['usehashtype']=="ripemd128") { $iDBHashType = "iDBHRMD128"; }
130 if($_POST['usehashtype']=="ripemd160") { $iDBHashType = "iDBHRMD160"; }
131 if($_POST['usehashtype']=="ripemd256") { $iDBHashType = "iDBHRMD256"; }
132 if($_POST['usehashtype']=="ripemd320") { $iDBHashType = "iDBHRMD320"; }
133 if ($_POST['AdminUser']=="Guest") { $Error="Yes";
134 echo "<br />You can not use Guest as your name."; }
135 /* We are done now with fixing the info. ^_^ */
136 $SQLStat = sql_connect_db($_POST['DatabaseHost'],$_POST['DatabaseUserName'],$_POST['DatabasePassword'],$_POST['DatabaseName']);
137 $SQLCollate = "latin1_general_ci";
138 $SQLCharset = "latin1";
139 if($Settings['charset']=="ISO-8859-1") {
140 $SQLCollate = "latin1_general_ci";
141 $SQLCharset = "latin1"; }
142 if($Settings['charset']=="ISO-8859-15") {
143 $SQLCollate = "latin1_general_ci";
144 $SQLCharset = "latin1"; }
145 if($Settings['charset']=="UTF-8") {
146 $SQLCollate = "utf8_unicode_ci";
147 $SQLCharset = "utf8"; }
148 sql_set_charset($SQLCharset,$SQLStat);
149 if($SQLStat===false) { $Error="Yes";
150 echo "<br />".sql_errorno($SQLStat)."\n"; }
151 if ($Error!="Yes") {
152 $ServerUUID = rand_uuid("rand");
153 if(!is_numeric($_POST['YourOffSet'])) { $_POST['YourOffSet'] = "0"; }
154 if(!is_numeric($_POST['MinOffSet'])) { $_POST['MinOffSet'] = "00"; }
155 if($_POST['MinOffSet']<0) { $_POST['MinOffSet'] = "00"; }
156 $YourOffSet = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
157 $AdminDST = $_POST['DST'];
158 $MyDay = GMTimeGet("d",$YourOffSet,0,$AdminDST);
159 $MyMonth = GMTimeGet("m",$YourOffSet,0,$AdminDST);
160 $MyYear = GMTimeGet("Y",$YourOffSet,0,$AdminDST);
161 $MyYear10 = $MyYear+10;
162 $YourDateEnd = $YourDate;
163 $EventMonth = GMTimeChange("m",$YourDate,0,0,"off");
164 $EventMonthEnd = GMTimeChange("m",$YourDateEnd,0,0,"off");
165 $EventDay = GMTimeChange("d",$YourDate,0,0,"off");
166 $EventDayEnd = GMTimeChange("d",$YourDateEnd,0,0,"off");
167 $EventYear = GMTimeChange("Y",$YourDate,0,0,"off");
168 $EventYearEnd = GMTimeChange("Y",$YourDateEnd,0,0,"off");
169 $KarmaBoostDay = $EventMonth.$EventDay;
170 $NewPassword = b64e_hmac($_POST['AdminPasswords'],$YourDate,$YourSalt,$_POST['usehashtype']);
171 //$Name = stripcslashes(htmlspecialchars($AdminUser, ENT_QUOTES, $Settings['charset']));
172 //$YourWebsite = "http://".$_SERVER['HTTP_HOST'].$this_dir."index.php?act=view";
173 $_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
174 $_POST['WebURL'] = remove_spaces($_POST['WebURL']);
175 $YourWebsite = $_POST['WebURL'];
176 $UserIP = $_SERVER['REMOTE_ADDR'];
177 $PostCount = 2;
178 $Email = "admin@".$_SERVER['HTTP_HOST'];
179 $AdminTime = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
180 $GEmail = "guest@".$_SERVER['HTTP_HOST'];
181 $grand = rand(6,16); $i = 0; $gpass = "";
182 while ($i < $grand) {
183 $csrand = rand(1,3);
184 if($csrand!=1&&$csrand!=2&&$csrand!=3) { $csrand=1; }
185 if($csrand==1) { $gpass .= chr(rand(48,57)); }
186 if($csrand==2) { $gpass .= chr(rand(65,90)); }
187 if($csrand==3) { $gpass .= chr(rand(97,122)); }
188 ++$i; } $GuestPassword = b64e_hmac($gpass,$YourDate,$GSalt,$_POST['usehashtype']);
189 $url_this_dir = "http://".$_SERVER['HTTP_HOST'].$this_dir."index.php?act=view";
190 $YourIP = $_SERVER['REMOTE_ADDR'];
191 if($Settings['sqltype']=="mysql"||
192 $Settings['sqltype']=="mysqli") {
193 require($SetupDir['sql'].'mysql.php'); }
194 if($Settings['sqltype']=="pgsql") {
195 require($SetupDir['sql'].'pgsql.php'); }
196 if($Settings['sqltype']=="sqlite") {
197 require($SetupDir['sql'].'sqlite.php'); }
198 if($_POST['SQLThemes']=="on") {
199 $OldThemeSet = $ThemeSet;
200 $Settings['board_name'] = $_POST['NewBoardName'];
201 $skindir = dirname(realpath("sql.php"))."/".$SettDir['themes'];
202 if ($handle = opendir($skindir)) { $dirnum = null;
203 while (false !== ($file = readdir($handle))) {
204 if ($dirnum==null) { $dirnum = 0; }
205 if (file_exists($skindir.$file."/info.php")) {
206 if ($file != "." && $file != "..") {
207 include($skindir.$file."/info.php");
208 $themelist[$dirnum] = $file;
209 ++$dirnum; } } }
210 closedir($handle); asort($themelist);
211 $themenum=count($themelist); $themei=0;
212 while ($themei < $themenum) {
213 include($skindir.$themelist[$themei]."/settings.php");
214 $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."themes\" (\"Name\", \"ThemeName\", \"ThemeMaker\", \"ThemeVersion\", \"ThemeVersionType\", \"ThemeSubVersion\", \"MakerURL\", \"CopyRight\", \"CSS\", \"CSSType\", \"FavIcon\", \"TableStyle\", \"MiniPageAltStyle\", \"PreLogo\", \"Logo\", \"LogoStyle\", \"SubLogo\", \"TopicIcon\", \"MovedTopicIcon\", \"HotTopic\", \"MovedHotTopic\", \"PinTopic\", \"AnnouncementTopic\", \"MovedPinTopic\", \"HotPinTopic\", \"MovedHotPinTopic\", \"ClosedTopic\", \"MovedClosedTopic\", \"HotClosedTopic\", \"MovedHotClosedTopic\", \"PinClosedTopic\", \"MovedPinClosedTopic\", \"HotPinClosedTopic\", \"MovedHotPinClosedTopic\", \"MessageRead\", \"MessageUnread\", \"Profile\", \"WWW\", \"PM\", \"TopicLayout\", \"AddReply\", \"FastReply\", \"NewTopic\", \"QuoteReply\", \"EditReply\", \"DeleteReply\", \"Report\", \"LineDivider\", \"ButtonDivider\", \"LineDividerTopic\", \"TitleDivider\", \"ForumStyle\", \"ForumIcon\", \"SubForumIcon\", \"RedirectIcon\", \"TitleIcon\", \"NavLinkIcon\", \"NavLinkDivider\", \"StatsIcon\", \"NoAvatar\", \"NoAvatarSize\") VALUES\n".
215 "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s');", array($themelist[$themei], $ThemeSet['ThemeName'], $ThemeSet['ThemeMaker'], $ThemeSet['ThemeVersion'], $ThemeSet['ThemeVersionType'], $ThemeSet['ThemeSubVersion'], $ThemeSet['MakerURL'], $ThemeSet['CopyRight'], $ThemeSet['CSS'], $ThemeSet['CSSType'], $ThemeSet['FavIcon'], $ThemeSet['TableStyle'], $ThemeSet['MiniPageAltStyle'], $ThemeSet['PreLogo'], $ThemeSet['Logo'], $ThemeSet['LogoStyle'], $ThemeSet['SubLogo'], $ThemeSet['TopicIcon'], $ThemeSet['MovedTopicIcon'], $ThemeSet['HotTopic'], $ThemeSet['MovedHotTopic'], $ThemeSet['PinTopic'], $ThemeSet['AnnouncementTopic'], $ThemeSet['MovedPinTopic'], $ThemeSet['HotPinTopic'], $ThemeSet['MovedHotPinTopic'], $ThemeSet['ClosedTopic'], $ThemeSet['MovedClosedTopic'], $ThemeSet['HotClosedTopic'], $ThemeSet['MovedHotClosedTopic'], $ThemeSet['PinClosedTopic'], $ThemeSet['MovedPinClosedTopic'], $ThemeSet['HotPinClosedTopic'], $ThemeSet['MovedHotPinClosedTopic'], $ThemeSet['MessageRead'], $ThemeSet['MessageUnread'], $ThemeSet['Profile'], $ThemeSet['WWW'], $ThemeSet['PM'], $ThemeSet['TopicLayout'], $ThemeSet['AddReply'], $ThemeSet['FastReply'], $ThemeSet['NewTopic'], $ThemeSet['QuoteReply'], $ThemeSet['EditReply'], $ThemeSet['DeleteReply'], $ThemeSet['Report'], $ThemeSet['LineDivider'], $ThemeSet['ButtonDivider'], $ThemeSet['LineDividerTopic'], $ThemeSet['TitleDivider'], $ThemeSet['ForumStyle'], $ThemeSet['ForumIcon'], $ThemeSet['SubForumIcon'], $ThemeSet['RedirectIcon'], $ThemeSet['TitleIcon'], $ThemeSet['NavLinkIcon'], $ThemeSet['NavLinkDivider'], $ThemeSet['StatsIcon'], $ThemeSet['NoAvatar'], $ThemeSet['NoAvatarSize']));
216 sql_query($query,$SQLStat);
217 ++$themei; } }
218 $ThemeSet = $OldThemeSet; }
219 $CHMOD = $_SERVER['PHP_SELF'];
220 $iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
221 $iDBRSVN = $VER2[2]." ".$SubVerN;
222 $LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
223 $pretext = "<?php\n/*\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n Revised BSD License for more details.\n\n Copyright 2004-".$SVNDay[2]." iDB Support - http://idb.berlios.de/\n Copyright 2004-".$SVNDay[2]." Game Maker 2k - http://gamemaker2k.org/\n iDB Installer made by Game Maker 2k - http://idb.berlios.net/\n\n \$FileInfo: settings.php & settingsbak.php - ".$LastUpdateS." - Author: cooldude2k \$\n*/\n";
224 $pretext2 = array("/* Board Setting Section Begins */\n\$Settings = array();","/* Board Setting Section Ends \n Board Info Section Begins */\n\$SettInfo = array();","/* Board Setting Section Ends \n Board Dir Section Begins */\n\$SettDir = array();","/* Board Dir Section Ends */");
225 $settcheck = "\$File3Name = basename(\$_SERVER['SCRIPT_NAME']);\nif (\$File3Name==\"settings.php\"||\$File3Name==\"/settings.php\"||\n \$File3Name==\"settingsbak.php\"||\$File3Name==\"/settingsbak.php\") {\n header('Location: index.php');\n exit(); }\n";
226 $BoardSettings=$pretext2[0]."\n".
227 "\$Settings['sqlhost'] = '".$_POST['DatabaseHost']."';\n".
228 "\$Settings['sqldb'] = '".$_POST['DatabaseName']."';\n".
229 "\$Settings['sqltable'] = '".$_POST['tableprefix']."';\n".
230 "\$Settings['sqluser'] = '".$_POST['DatabaseUserName']."';\n".
231 "\$Settings['sqlpass'] = '".$_POST['DatabasePassword']."';\n".
232 "\$Settings['sqltype'] = '".$_POST['DatabaseType']."';\n".
233 "\$Settings['board_name'] = '".$_POST['NewBoardName']."';\n".
234 "\$Settings['idbdir'] = '".$idbdir."';\n".
235 "\$Settings['idburl'] = '".$_POST['BoardURL']."';\n".
236 "\$Settings['enable_https'] = 'off';\n".
237 "\$Settings['weburl'] = '".$_POST['WebURL']."';\n".
238 "\$Settings['SQLThemes'] = '".$_POST['SQLThemes']."';\n".
239 "\$Settings['use_gzip'] = '".$_POST['GZip']."';\n".
240 "\$Settings['html_type'] = '".$_POST['HTMLType']."';\n".
241 "\$Settings['html_level'] = '".$_POST['HTMLLevel']."';\n".
242 "\$Settings['output_type'] = '".$_POST['OutPutType']."';\n".
243 "\$Settings['GuestGroup'] = 'Guest';\n".
244 "\$Settings['MemberGroup'] = 'Member';\n".
245 "\$Settings['ValidateGroup'] = 'Validate';\n".
246 "\$Settings['AdminValidate'] = 'off';\n".
247 "\$Settings['TestReferer'] = '".$_POST['TestReferer']."';\n".
248 "\$Settings['DefaultTheme'] = '".$_POST['DefaultTheme']."';\n".
249 "\$Settings['DefaultTimeZone'] = '".$AdminTime."';\n".
250 "\$Settings['DefaultDST'] = '".$AdminDST."';\n".
251 "\$Settings['start_date'] = ".$YourDate.";\n".
252 "\$Settings['use_hashtype'] = '".$_POST['usehashtype']."';\n".
253 "\$Settings['charset'] = '".$_POST['charset']."';\n".
254 "\$Settings['add_power_by'] = 'off';\n".
255 "\$Settings['send_pagesize'] = 'off';\n".
256 "\$Settings['max_posts'] = '10';\n".
257 "\$Settings['max_topics'] = '10';\n".
258 "\$Settings['max_memlist'] = '10';\n".
259 "\$Settings['max_pmlist'] = '10';\n".
260 "\$Settings['hot_topic_num'] = '15';\n".
261 "\$Settings['qstr'] = '&';\n".
262 "\$Settings['qsep'] = '=';\n".
263 "\$Settings['file_ext'] = '.php';\n".
264 "\$Settings['rss_ext'] = '.php';\n".
265 "\$Settings['js_ext'] = '.js';\n".
266 "\$Settings['showverinfo'] = 'on';\n".
267 "\$Settings['vercheck'] = 1;\n".
268 "\$Settings['enable_rss'] = 'on';\n".
269 "\$Settings['enable_search'] = 'on';\n".
270 "\$Settings['sessionid_in_urls'] = 'off';\n".
271 "\$Settings['fixpathinfo'] = 'off';\n".
272 "\$Settings['fixbasedir'] = 'off';\n".
273 "\$Settings['fixcookiedir'] = 'off';\n".
274 "\$Settings['fixredirectdir'] = 'off';\n".
275 "\$Settings['enable_pathinfo'] = 'off';\n".
276 "\$Settings['rssurl'] = 'off';\n".
277 "\$Settings['board_offline'] = 'off';\n".
278 "\$Settings['BoardUUID'] = '".$ServerUUID."';\n".
279 "\$Settings['KarmaBoostDays'] = '".$KarmaBoostDay."';\n".
280 "\$Settings['KBoostPercent'] = '6|10';\n".$pretext2[1]."\n".
281 "\$SettInfo['board_name'] = '".$_POST['NewBoardName']."';\n".
282 "\$SettInfo['Author'] = '".$_POST['AdminUser']."';\n".
283 "\$SettInfo['Keywords'] = '".$_POST['NewBoardName'].",".$_POST['AdminUser']."';\n".
284 "\$SettInfo['Description'] = '".$_POST['NewBoardName'].",".$_POST['AdminUser']."';\n".$pretext2[2]."\n".
285 "\$SettDir['maindir'] = '".$idbdir."';\n".
286 "\$SettDir['inc'] = 'inc/';\n".
287 "\$SettDir['misc'] = 'inc/misc/';\n".
288 "\$SettDir['sql'] = 'inc/misc/sql/';\n".
289 "\$SettDir['admin'] = 'inc/admin/';\n".
290 "\$SettDir['sqldumper'] = 'inc/admin/sqldumper/';\n".
291 "\$SettDir['mod'] = 'inc/mod/';\n".
292 "\$SettDir['themes'] = 'themes/';\n".$pretext2[3]."\n?>";
293 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
294 $BoardSettings = $pretext.$settcheck.$BoardSettings;
295 $fp = fopen("settings.php","w+");
296 fwrite($fp, $BoardSettings);
297 fclose($fp);
298 // cp("settings.php","settingsbak.php");
299 $fp = fopen("settingsbak.php","w+");
300 fwrite($fp, $BoardSettingsBak);
301 fclose($fp);
302 if($_POST['storecookie']=="true") {
303 if($URLsTest['host']!="localhost") {
304 setcookie("MemberName", $_POST['AdminUser'], time() + (7 * 86400), $this_dir, $URLsTest['host']);
305 setcookie("UserID", 1, time() + (7 * 86400), $this_dir, $URLsTest['host']);
306 setcookie("SessPass", $NewPassword, time() + (7 * 86400), $this_dir, $URLsTest['host']); }
307 if($URLsTest['host']=="localhost") {
308 setcookie("MemberName", $_POST['AdminUser'], time() + (7 * 86400), $this_dir, false);
309 setcookie("UserID", 1, time() + (7 * 86400), $this_dir, false);
310 setcookie("SessPass", $NewPassword, time() + (7 * 86400), $this_dir, false); } }
311 $chdel = true;
312 if($Error!="Yes") {
313 if($_POST['unlink']=="true") {
314 $chdel1 = @unlink($SetupDir['setup'].'presetup.php'); $chdel2 = @unlink($SetupDir['setup'].'setup.php');
315 $chdel3 = @unlink($SetupDir['setup'].'mkconfig.php'); $chdel4 = @unlink($SetupDir['sql'].'mysql.php');
316 $chdel5 = @unlink($SetupDir['setup'].'index.php'); $chdel6 = @unlink($SetupDir['setup'].'license.php');
317 $chdel7 = @unlink($SetupDir['setup'].'preinstall.php'); $chdel8 = @unlink($SetupDir['convert'].'index.php');
318 if($ConvertInfo['ConvertFile']!=null) { $chdel0 = @unlink($ConvertInfo['ConvertFile']); }
319 $chdel9 = @unlink($SetupDir['convert'].'info.php');
320 $chdel14 = @unlink($SetupDir['sql'].'pgsql.php'); $chdel15 = @unlink($SetupDir['sql'].'sqlite.php');
321 $chdel10 = @rmdir($SetupDir['convert']); $chdel16 = @rmdir($SetupDir['sql']); $chdel11 = @rmdir('setup');
322 $chdel12 = @unlink('install.php'); } }
323 if($chdel1===false||$chdel2===false||$chdel3===false||$chdel4===false) { $chdel = false; }
324 if($chdel5===false||$chdel6===false||$chdel7===false||$chdel8===false) { $chdel = false; }
325 if($chdel9===false||$chdel10===false||$chdel11===false||$chdel12===false) { $chdel = false; }
326 if($chdel4===false||$chdel15===false||$chdel16===false) { $chdel = false; }
327 if($ConvertInfo['ConvertFile']!=null) { if($chdel0===false) { $chdel = false; } }
328 ?><span class="TableMessage">
329 <br />Install Finish <a href="index.php?act=view">Click here</a> to goto board. ^_^</span>
330 <?php if($chdel===false) { ?><span class="TableMessage">
331 <br />Error: Cound not delete installer. Read readme.txt for more info.</span>
332 <?php } ?><br /><br />
333 </td>
334 </tr>
335 <?php } ?>