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:
|
<?php
/** Hier wird beschaut ob alle benötigten Datein in dem Ordner liegen **/
if(file_exists("./lib/install.lock")) die("Lösche die /acp/lib/install.lock um die setup.php Auszuführen");
if(!file_exists("setup.sql")) die("Lade bitte die setup.sql in den Ordner acp/");
if(!file_exists("setup.wbb")) die("Lade bitte die setup.wbb in den Ordner acp/");
@error_reporting(7);
@set_time_limit(0);
@set_magic_quotes_runtime(0);
$phpversion = phpversion();
/** Unwichtig zu kommentieren **/
require("./lib/functions.php");
require("./lib/admin_functions.php");
if(version_compare($phpversion, "4.1.0")==-1) {
$_REQUEST=array_merge($HTTP_COOKIE_VARS,$HTTP_POST_VARS,$HTTP_GET_VARS);
$_COOKIE=&$HTTP_COOKIE_VARS;
$_SERVER=&$HTTP_SERVER_VARS;
$_FILES=&$HTTP_POST_FILES;
$_GET=&$HTTP_GET_VARS;
$_POST=&$HTTP_POST_VARS;
}
/** Unwichtig zu kommenteieren **/
if(get_magic_quotes_gpc()) {
if(is_array($_REQUEST)) $_REQUEST=stripslashes_array($_REQUEST);
if(is_array($_POST)) $_POST=stripslashes_array($_POST);
if(is_array($_GET)) $_GET=stripslashes_array($_GET);
if(is_array($_COOKIE)) $_COOKIE=stripslashes_array($_COOKIE);
}
/** Datenbankverbindung herstellen **/
require("./lib/config.inc.php");
require("./lib/class_db_mysql.php");
$db = new db($sqlhost,$sqluser,$sqlpassword,$sqldb,$phpversion);
/** page output function **/
function informationPage($content, $title="Installation") {
echo '<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de" xml:lang="de">
<head>
<title>' . $title . '</title>
<link rel="stylesheet" href="css/other.css" />
</head>
<body>
<table align="center" width="600">
<tr>
<td align="center"><img src="images/acp-logo.gif" border="0" alt="" /></td>
</tr>
<tr>
<td><br /><br />' . $content . '</td>
</tr>
</table>
</body>
</html>';
}
/** Fehlermeldungsseite **/
function diewitherror($error="unbekannter Fehler", $title="unbekannter Fehler") {
echo '<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de" xml:lang="de">
<head>
<title>' . $title . '</title>
<link rel="stylesheet" href="css/other.css" />
</head>
<body>
<table align="center" width="600">
<tr>
<td align="center"><img src="images/acp-logo.gif" border="0" alt="" /></td>
</tr>
<tr>
<td><br /><br />Bei der Installation ist ein Fehler aufgetreten.<br />Fehlermeldung: '.$error.'</td>
</tr>
</table>
</body>
</html>';
exit();
}
// startendes setup
if(isset($_REQUEST['step'])) $step=intval($_REQUEST['step']);
else $step=0;
if(isset($_REQUEST['loop'])) $loop=intval($_REQUEST['loop']);
else $loop=0;
if($loop<0) $loop=0;
// start seite
if($step == 0) {
informationPage('<p><font size="2"><b>Installation ausführen?:</b></font><br /><br /><a href="setup.php?step=1">Ja</a> | <a href="../index.php">Nein');
}
// 1. step: SQL Datei wird importiert
elseif($step == 1) {
require_once("./lib/class_query.php");
$fp=fopen("./setup.sql", "rb");
$query=fread($fp, filesize("./setup.sql"));
fclose($fp);
if($n!=1) {
$query=str_replace("bb1_","bb".$n."_",$query);
}
$sql_query = new query($query);
$sql_query->doquery();
informationPage('<b>Die neuen Tabellen wurden erfolgreich erstellt und einige bestehende Tabellen wurden verändert.</b><br /><br /><a href="setup.php?step=2">Klicken Sie hier, um mit der Installation fortzufahren.</a>');
}
// 2. step: ACP Menüpunkte werden hinzugefügt
elseif($step == 2) {
require_once("./lib/class_variableimport.php");
$variableimport = new variableimport("./setup.wbb");
if($variableimport->errors()) echo 'Ungültige Variablendatei: <br />'.$variableimport->getErrors().'<br />';
else {
$variableimport->import();
if($variableimport->errors()) diewitherror("Ungültige Variablendatei: ".$variableimport->getErrors());
}
informationPage('<b>Die neuen Gruppenvariablen und ACP-Links wurden erfolgreich eingerichtet.</b><br /><br /><a href="setup.php?step=3">Klicken Sie hier, um mit der Installation fortzufahren.</a>');
}
// 3. step: end installation
elseif($step == 3) {
require_once("./lib/class_options.php");
$option=new options("lib");
$option->write();
$fp=@fopen("./lib/install.lock", "w+b");
fclose($fp);
@unlink("setup.wbb");
@unlink("setup.sql");
@unlink("setup.php");
informationPage('<b>Die Installation wurde erfolgreich beendet.</b></a>');
}
?> |