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:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
|
<?php
@error_reporting(7);
@set_time_limit(0);
@set_magic_quotes_runtime(0);
$phpversion=(int)(str_replace(".","",phpversion()));
require("./lib/functions.php");
if($phpversion<410) {
$_REQUEST=array();
$_COOKIE=array();
$_POST=array();
$_GET=array();
$_SERVER=array();
$_FILES=array();
get_vars_old();
}
if(isset($_REQUEST['step'])) $step=intval($_REQUEST['step']);
else $step=0;
if(isset($_REQUEST['ustep'])) $ustep=intval($_REQUEST['ustep']);
else $ustep=0;
if(isset($_REQUEST['mode'])) $mode=intval($_REQUEST['mode']);
else $mode=0;
if($step==0 && $ustep==0) {
@chmod("./../",0777);
@chmod("./../../",0777);
@chmod("./../images/avatars",0777);
@chmod("./lib",0777);
@chmod("./lib/config.inc.php",0777);
@chmod("./lib/options.inc.php",0777);
?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td><b>Herzlich Willkommen bei der Einrichtung vom WoltLab Burning Board Lite 1.0.2</b></td>
</tr>
<tr>
<td> <br><i>Systemvoraussetzungen:</i>
<table>
<tr>
<td><u>Eigenschaft</u></td>
<td><u>erforderlich</u></td>
<td><u>vorhanden</u></td>
</tr>
<tr>
<td>PHP Version</td>
<td>4.0.1</td>
<td bgcolor="<?php if($phpversion<401) echo "red"; else echo "green"; ?>">
<?php echo phpversion(); ?></td>
</tr>
<tr>
<td>magic_quotes_sybase</td>
<td>deaktiviert</td>
<td bgcolor="<?php if(get_cfg_var("magic_quotes_sybase")) echo "red"; else echo "green"; ?>">
<?php if(get_cfg_var("magic_quotes_sybase")) echo "aktiviert";
else echo "deaktiviert"; ?></td>
</tr>
<tr>
<td>upload_max_filesize</td>
<td>> 0</td>
<td bgcolor="<?php if(!get_cfg_var("upload_max_filesize")) echo "red"; else echo "green"; ?>">
<?php echo get_cfg_var("upload_max_filesize"); ?></td>
</tr>
<tr>
<td>Schreibrechte in "acp/lib"</td>
<td>Ja</td>
<td bgcolor="<?php if(!is_writeable("lib")) echo "red"; else echo "green"; ?>">
<?php if(is_writeable("lib")) echo "Ja";
else echo "Nein"; ?></td>
</tr>
<tr>
<td>Schreibrechte in "images/avatars"</td>
<td>Ja</td>
<td bgcolor="<?php if(!is_writeable("../images/avatars")) echo "red"; else echo "green"; ?>">
<?php if(is_writeable("../images/avatars")) echo "Ja";
else echo "Nein"; ?></td>
</tr>
</table>
<p><i>Sollten eine oder mehrere Voraussetzungen nicht erfüllt sein, kann ein einwandfreier Betrieb des Forum nicht gewährleistet werden.</i></p>
<form method="post" action="setup.php"><select name="mode">
<option value="0">Bitte wählen Sie die Einrichtungsart:</option>
<option value="1">Neuinstallation</option>
<option value="3">Umstellung von wBB Lite 1.0.1</option>
<option value="2">Umstellung von wBB 1.0 Beta 4.0 oder höher</option>
</select> <input type="submit" value="Fortfahren">
<input type="hidden" name="step" value="1">
</form>
</td>
</tr>
</table>
</body></html>
<?php
}
if($step==1) {
if(!$mode) {
header("Location: setup.php?step=0");
exit();
}
if($mode == 3) {
header("Location: setup.php?ustep=1");
exit();
}
if(isset($_POST['send'])) {
$fp=fopen("./lib/config.inc.php","w+");
fwrite($fp,"<?php
// Hostname oder IP des MySQL-Servers
\$sqlhost = "".str_replace(""","\\\\"",$_POST['sqlhost'])."";
// Username und Passwort zum einloggen in den Datenbankserver
\$sqluser = "".str_replace(""","\\\\"",$_POST['sqluser'])."";
\$sqlpassword = "".str_replace(""","\\\\"",$_POST['sqlpassword'])."";
// Name der Datenbank
\$sqldb = "".str_replace(""","\\\\"",$_POST['sqldb'])."";
// Nummer des Boards
\$n = "".intval($_POST['n'])."";
// Email des Admins
\$adminmail = "".str_replace(""","\\\\"",$_POST['adminmail'])."";
?>");
fclose($fp);
header("Location: setup.php?step=2&mode=$mode");
exit();
}
else {
require("./lib/config.inc.php");
?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td><b>Einstellung der Datenbankzugriffsdaten</b></td>
</tr>
<tr>
<td>
<table><form method="post" action="setup.php">
<tr>
<td>Adresse des Datenbankservers:</td>
<td><input type="text" name="sqlhost" value="<?php echo $sqlhost; ?>"></td>
</tr>
<tr>
<td>Datenbank-Benutzername:</td>
<td><input type="text" name="sqluser" value="<?php echo $sqluser; ?>"></td>
</tr>
<tr>
<td>Datenbank-Benutzerpasswort:</td>
<td><input type="text" name="sqlpassword" value="<?php echo $sqlpassword; ?>"></td>
</tr>
<tr>
<td>Datenbankname:</td>
<td><input type="text" name="sqldb" value="<?php echo $sqldb; ?>"></td>
</tr>
<tr>
<td>Nummer des Forums:</td>
<td><input type="text" name="n" value="<?php echo $n; ?>"></td>
</tr>
<tr>
<td>eMail des techn. Admins:</td>
<td><input type="text" name="adminmail" value="<?php echo $adminmail; ?>"></td>
</tr>
</table>
<p align="center"><input type="submit" value="Speichern"> <input type="reset" value="Zurücksetzen"></p>
<input type="hidden" name="step" value="1">
<input type="hidden" name="send" value="send">
<input type="hidden" name="mode" value="<?php echo $mode; ?>">
</form><a href="setup.php?step=2&mode=<?php echo $mode; ?>">Falls Sie bereits die Datei "config.inc.php" von Hand konfiguriert haben, können Sie diesen Schritt überspringen.</a>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td bgcolor="red">Bitte beachten Sie, dass bei einem Update von wBB 1.0 Beta 4.0 oder höher die Installationsnummer nicht identisch sein darf, da ansonsten ein Datenverlust nicht auszuschliessen ist.</td>
</tr>
</table>
</body></html>
<?php
}
}
if($step==2) {
require("./lib/config.inc.php");
$error=0;
$connid=@mysql_connect($sqlhost,$sqluser,$sqlpassword);
if(!$connid) $error=1;
else {
if(!@mysql_select_db($sqldb,$connid)) $error=1;
else {
header("Location: setup.php?step=3&mode=$mode");
exit();
}
}
if($error=1) { ?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td>Es sind Fehler beim Verbinden mit dem Datenbankserver aufgetreten. Die von Ihnen angegebenen Datenbankzugriffsdaten sind womöglich nicht korrekt.
<br><br><a href="setup.php?step=1&mode=<?php echo $mode; ?>">Bitte kehren Sie auf die vorherige Seite zurück, und korrigieren Ihre Angaben noch einmal.</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
}
if($step==3) {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$tables=array(
"bb".$n."_access",
"bb".$n."_adminsessions",
"bb".$n."_announcements",
"bb".$n."_attachments",
"bb".$n."_avatars",
"bb".$n."_bbcodes",
"bb".$n."_boards",
"bb".$n."_events",
"bb".$n."_folders",
"bb".$n."_groups",
"bb".$n."_icons",
"bb".$n."_moderators",
"bb".$n."_optiongroups",
"bb".$n."_options",
"bb".$n."_permissions",
"bb".$n."_polloptions",
"bb".$n."_polls",
"bb".$n."_posts",
"bb".$n."_privatemessage",
"bb".$n."_profilefields",
"bb".$n."_ranks",
"bb".$n."_searchs",
"bb".$n."_sessions",
"bb".$n."_smilies",
"bb".$n."_styles",
"bb".$n."_subscribeboards",
"bb".$n."_subscribethreads",
"bb".$n."_subvariablepacks",
"bb".$n."_subvariables",
"bb".$n."_templatepacks",
"bb".$n."_templates",
"bb".$n."_threads",
"bb".$n."_userfields",
"bb".$n."_users",
"bb".$n."_votes",
"bb".$n."_wordlist",
"bb".$n."_wordmatch");
$c=0;
$result = mysql_list_tables($sqldb);
for($i=0; $i<$db->num_rows($result); $i++) {
if(in_array(mysql_tablename($result,$i),$tables)) {
$c=1;
break;
}
}
if($c==1) { ?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td>Es sind bereits Tabellen in der ausgewählten Datenbank vorhanden, die von dieser Installation erstellt werden sollen. Wenn Sie fortfahren werden die vorhandenen Tabellen samt Daten überschrieben.
<br><br><a href="setup.php?step=4&mode=<?php echo $mode; ?>">Fortfahren</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
else {
header("Location: setup.php?step=4&mode=$mode");
exit();
}
}
if($step==4) {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
require("./lib/class_query.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$query=implode("",file("./lib/structure.sql"));
if($n!=1) $query=str_replace("bb1_","bb".$n."_",$query);
$sql_query = new query($query);
$sql_query->doquery();
header("Location: setup.php?step=5&mode=$mode");
exit();
}
if($step==5) {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
require("./lib/class_query.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$query=implode("",file("./lib/inserts.sql"));
if($n!=1) $query=str_replace("bb1_","bb".$n."_",$query);
$sql_query = new query($query);
$sql_query->doquery();
list($version) = $db->query_first("SELECT VERSION()");
if( preg_match("/^(3\.23)|(4\.)/", $version) ) $db->query("ALTER TABLE bb".$n."_sessions TYPE=HEAP");
header("Location: setup.php?step=6&mode=$mode");
exit();
}
if($step==6) {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$split="~~~";
$stylefile="bb1.style";
if(file_exists($stylefile)) {
$file = file($stylefile);
$firstrow = explode($split,array_shift($file));
$file=explode($split.$split,implode("",$file));
$db->query("INSERT INTO bb".$n."_subvariablepacks (subvariablepackid,subvariablepackname) VALUES (NULL,'".addslashes($firstrow[1])."')");
$subvariablepackid=$db->insert_id();
$subvariables=explode($split,$file[0]);
for($i=0;$i<count($subvariables)/2;$i++) $db->unbuffered_query("INSERT INTO bb".$n."_subvariables (subvariableid,subvariablepackid,variable,substitute) VALUES (NULL,'$subvariablepackid','".addslashes($subvariables[($i*2)])."','".addslashes($subvariables[($i*2+1)])."')",1);
if($firstrow[2]==-1) $templatepackid=0;
else {
$db->query("INSERT INTO bb".$n."_templatepacks (templatepackid,templatepackname) VALUES (NULL,'".addslashes($firstrow[2])."')");
$templatepackid=$db->insert_id();
}
$templates=explode($split,$file[1]);
for($i=0;$i<count($templates)/2;$i++) $db->unbuffered_query("REPLACE INTO bb".$n."_templates (templateid,templatepackid,templatename,template) VALUES (NULL,'$templatepackid','".addslashes($templates[($i*2)])."','".addslashes($templates[($i*2+1)])."')");
$db->unbuffered_query("INSERT INTO bb".$n."_styles (styleid,stylename,templatepackid,subvariablepackid,default_style) VALUES (NULL,'".addslashes($firstrow[0])."','$templatepackid','$subvariablepackid','1') ",1);
header("Location: setup.php?step=7&mode=$mode");
exit();
}
else { ?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td>Fehler: Style Datei konnte nicht gefunden werdne. Bitte vergewissern Sie sich, dass sich die Datei "bb1.style" im Verzeichnis "acp" befindet.
<br><br><a href="setup.php?step=6&mode=<?php echo $mode; ?>">Erneut versuchen</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
}
if($step==7) {
if($mode==2) {
header("Location: update.php");
exit();
}
$username=trim($_REQUEST['username']);
$email=trim($_REQUEST['email']);
$password=trim($_REQUEST['password']);
if(isset($_POST['send'])) {
if($username && $email && $password) {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$db->query("INSERT INTO bb".$n."_users (userid,username,password,email,groupid,rankid,regdate,lastvisit,lastactivity,activation,timezoneoffset) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".md5($password)."','".addslashes(htmlspecialchars($email))."','1','1','".time()."','".time()."','".time()."','1','0')");
$userid=$db->insert_id();
$db->query("INSERT INTO bb".$n."_userfields (userid) VALUES ('$userid')");
header("Location: setup.php?step=8&mode=$mode");
exit();
}
}
?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td><b>Registrierung des Administrators</b></td>
</tr>
<tr>
<td>
<table><form method="post" action="setup.php">
<tr>
<td>Benutzername:</td>
<td><input type="text" name="username" value="<?php echo $username; ?>"></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="text" name="password" value="<?php echo $password; ?>"></td>
</tr>
<tr>
<td>eMail Adresse:</td>
<td><input type="text" name="email" value="<?php echo $email; ?>"></td>
</tr>
</table>
<p align="center"><input type="submit" value="Speichern"> <input type="reset" value="Zurücksetzen"></p>
<input type="hidden" name="step" value="7">
<input type="hidden" name="send" value="send">
<input type="hidden" name="mode" value="<?php echo $mode; ?>">
</form>
</td>
</tr>
</table>
</body>
</html>
<?php
}
if($step==8) {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
require ("./lib/class_options.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$db->query("UPDATE bb".$n."_options SET value='".time()."' WHERE varname='installdate'");
$option=new options("lib");
$option->write(); ?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td><b>Einrichtung ist erfolgreich abgeschlossen.</b> Bitte löschen Sie die "setup.php", um sich gegen ein späteres überschreiben Ihres Forums zu schützen.
<br><br><a href="index.php">Klicken Sie hier, um ins Admin Control Panel zu gelangen</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
if($ustep=="1") {
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
require("./lib/class_options.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
$db->query("UPDATE bb".$n."_options SET value='1.0.2' WHERE varname='boardversion'");
$option=new options("lib");
$option->write();
?>
<html>
<head>
<link rel="stylesheet" href="css/other.css">
</head>
<body>
<table align="center" width="400">
<tr>
<td align="center"><img src="images/acp-logo.gif"></td>
</tr>
<tr>
<td><b>Update auf wBB Lite 1.0.2 ist erfolgreich abgeschlossen.</b> Bitte löschen Sie die "setup.php", um sich gegen ein späteres überschreiben Ihres Forums zu schützen.
<br><br><a href="index.php">Klicken Sie hier, um ins Admin Control Panel zu gelangen</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
?>
|