1 |
1349
|
Luisehahne
|
<?php
|
2 |
|
|
/**
|
3 |
1884
|
Luisehahne
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
4 |
1349
|
Luisehahne
|
*
|
5 |
1884
|
Luisehahne
|
* This program is free software: you can redistribute it and/or modify
|
6 |
|
|
* it under the terms of the GNU General Public License as published by
|
7 |
|
|
* the Free Software Foundation, either version 3 of the License, or
|
8 |
|
|
* (at your option) any later version.
|
9 |
1349
|
Luisehahne
|
*
|
10 |
1884
|
Luisehahne
|
* This program is distributed in the hope that it will be useful,
|
11 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
|
|
* GNU General Public License for more details.
|
14 |
|
|
*
|
15 |
|
|
* You should have received a copy of the GNU General Public License
|
16 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
1349
|
Luisehahne
|
*/
|
18 |
|
|
|
19 |
1884
|
Luisehahne
|
/**
|
20 |
|
|
* index.php
|
21 |
|
|
*
|
22 |
|
|
* @category Core
|
23 |
|
|
* @package Core_Environment
|
24 |
|
|
* @subpackage Installer
|
25 |
|
|
* @author Dietmar Wöllbrink <dietmar.woellbrink@websitebaker.org>
|
26 |
|
|
* @copyright Werner v.d.Decken <wkl@isteam.de>
|
27 |
|
|
* @license http://www.gnu.org/licenses/gpl.html GPL License
|
28 |
|
|
* @version 0.0.2
|
29 |
|
|
* @revision $Revision$
|
30 |
|
|
* @link $HeadURL$
|
31 |
|
|
* @lastmodified $Date$
|
32 |
|
|
* @since File available since 2012-04-01
|
33 |
|
|
* @description xyz
|
34 |
|
|
*/
|
35 |
2104
|
darkviper
|
// PHP less then 5.4.0 is prohibited ---
|
36 |
|
|
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
|
37 |
|
|
$sMsg = '<p style="color: #ff0000;">WebsiteBaker 2.8.4 and above is not able to run with PHP-Version less then 5.4.0!!<br />'
|
38 |
|
|
. 'Please change your PHP-Version to any kind from 5.4.0 and up!<br />'
|
39 |
2075
|
darkviper
|
. 'If you have problems to solve that, ask your hosting provider for it.<br />'
|
40 |
|
|
. 'The very best solution is the use of PHP-5.4 and up</p>';
|
41 |
|
|
die($sMsg);
|
42 |
|
|
}
|
43 |
2104
|
darkviper
|
include(__DIR__.'/InstallHelper.php');
|
44 |
1349
|
Luisehahne
|
// Start a session
|
45 |
|
|
if(!defined('SESSION_STARTED')) {
|
46 |
|
|
session_name('wb_session_id');
|
47 |
|
|
session_start();
|
48 |
|
|
define('SESSION_STARTED', true);
|
49 |
|
|
}
|
50 |
|
|
|
51 |
1884
|
Luisehahne
|
$doc_root = str_replace('\\','/',rtrim(realpath($_SERVER['DOCUMENT_ROOT']),'/').'/');
|
52 |
|
|
$wb_path = str_replace('\\','/',rtrim(dirname(dirname(realpath( __FILE__))),'/')).'/';
|
53 |
|
|
$wb_root = str_replace(($doc_root),'',$wb_path);
|
54 |
1530
|
Luisehahne
|
|
55 |
1349
|
Luisehahne
|
// Function to highlight input fields which contain wrong/missing data
|
56 |
|
|
function field_error($field_name='') {
|
57 |
|
|
if(!defined('SESSION_STARTED') || $field_name == '') return;
|
58 |
|
|
if(isset($_SESSION['ERROR_FIELD']) && $_SESSION['ERROR_FIELD'] == $field_name) {
|
59 |
|
|
return ' class="wrong"';
|
60 |
|
|
}
|
61 |
|
|
}
|
62 |
|
|
|
63 |
1529
|
Luisehahne
|
$installFlag = true;
|
64 |
1349
|
Luisehahne
|
// Check if the page has been reloaded
|
65 |
|
|
if(!isset($_GET['sessions_checked']) OR $_GET['sessions_checked'] != 'true') {
|
66 |
|
|
// Set session variable
|
67 |
|
|
$_SESSION['session_support'] = '<font class="good">Enabled</font>';
|
68 |
|
|
// Reload page
|
69 |
|
|
header('Location: index.php?sessions_checked=true');
|
70 |
|
|
exit(0);
|
71 |
|
|
} else {
|
72 |
|
|
// Check if session variable has been saved after reload
|
73 |
|
|
if(isset($_SESSION['session_support'])) {
|
74 |
|
|
$session_support = $_SESSION['session_support'];
|
75 |
1529
|
Luisehahne
|
} else {
|
76 |
|
|
$installFlag = false;
|
77 |
1349
|
Luisehahne
|
$session_support = '<font class="bad">Disabled</font>';
|
78 |
|
|
}
|
79 |
|
|
}
|
80 |
2030
|
Luisehahne
|
$getMagicQuotesGpc = '<font class="good">Disabled</font>';
|
81 |
|
|
if ( function_exists('get_magic_quotes_gpc') && filter_var(strtolower(get_magic_quotes_gpc()), FILTER_VALIDATE_BOOLEAN ) ) {
|
82 |
|
|
$getMagicQuotesGpc = '<font class="bad">Enabled</font>';
|
83 |
|
|
$installFlag = false;
|
84 |
|
|
}
|
85 |
|
|
|
86 |
1349
|
Luisehahne
|
// Check if AddDefaultCharset is set
|
87 |
|
|
$e_adc=false;
|
88 |
|
|
$sapi=php_sapi_name();
|
89 |
|
|
if(strpos($sapi, 'apache')!==FALSE || strpos($sapi, 'nsapi')!==FALSE) {
|
90 |
|
|
flush();
|
91 |
|
|
$apache_rheaders=apache_response_headers();
|
92 |
|
|
foreach($apache_rheaders AS $h) {
|
93 |
|
|
if(strpos($h, 'html; charset')!==FALSE) {
|
94 |
|
|
preg_match('/charset\s*=\s*([a-zA-Z0-9- _]+)/', $h, $match);
|
95 |
|
|
$apache_charset=$match[1];
|
96 |
|
|
$e_adc=$apache_charset;
|
97 |
|
|
}
|
98 |
|
|
}
|
99 |
|
|
}
|
100 |
|
|
|
101 |
1884
|
Luisehahne
|
//$sapi_type = php_sapi_name();
|
102 |
1737
|
Luisehahne
|
if(!isset($_SESSION['operating_system'])) {
|
103 |
1884
|
Luisehahne
|
$operating_system = ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'windows' : 'linux');
|
104 |
1737
|
Luisehahne
|
} else {
|
105 |
1884
|
Luisehahne
|
$operating_system = $_SESSION['operating_system'];
|
106 |
1737
|
Luisehahne
|
}
|
107 |
1884
|
Luisehahne
|
|
108 |
|
|
function checkConfigFile ($sWbPath,$sType ) {
|
109 |
|
|
$config = '';
|
110 |
|
|
$sConfigContent = "<?php\n";
|
111 |
|
|
$sConfigFile = $sWbPath.$sType.'.php';
|
112 |
|
|
|
113 |
|
|
// config.php or config.php.new
|
114 |
2030
|
Luisehahne
|
if ((file_exists($sConfigFile)==true)) {
|
115 |
1884
|
Luisehahne
|
// next operation only if file is writeable
|
116 |
2030
|
Luisehahne
|
if (is_writeable($sConfigFile)) {
|
117 |
1884
|
Luisehahne
|
// already installed? it's not empty
|
118 |
2030
|
Luisehahne
|
if (filesize($sConfigFile) > 100) {
|
119 |
1884
|
Luisehahne
|
$config = '<font class="bad">Already installed? Check!</font>';
|
120 |
|
|
// try to open and to write
|
121 |
2030
|
Luisehahne
|
} elseif (!$handle = fopen($sConfigFile, 'w')) {
|
122 |
1884
|
Luisehahne
|
$config = '<font class="bad">Not Writeable</font>';
|
123 |
|
|
} else {
|
124 |
|
|
if (fwrite($handle, $sConfigContent) === FALSE) {
|
125 |
|
|
$config = '<font class="bad">Not Writeable</font>';
|
126 |
|
|
} else {
|
127 |
|
|
$config = '';
|
128 |
|
|
$_SESSION[$sType.'_rename'] = true;
|
129 |
|
|
}
|
130 |
|
|
// Close file
|
131 |
|
|
fclose($handle);
|
132 |
2030
|
Luisehahne
|
}
|
133 |
1884
|
Luisehahne
|
} else {
|
134 |
|
|
$config = '<font class="bad">Not Writeable</font>';
|
135 |
|
|
}
|
136 |
|
|
// it's config.php.new
|
137 |
2030
|
Luisehahne
|
} elseif ((file_exists($sConfigFile.'.new')==true)) {
|
138 |
1884
|
Luisehahne
|
$config = '<font class="bad">Please rename to '.$sType.'.php</font>';
|
139 |
|
|
} else {
|
140 |
|
|
$config = '<font class="bad">Missing!!?</font>';
|
141 |
|
|
}
|
142 |
|
|
return $config;
|
143 |
|
|
}
|
144 |
|
|
|
145 |
|
|
|
146 |
1529
|
Luisehahne
|
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
147 |
1349
|
Luisehahne
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
148 |
|
|
<head>
|
149 |
1609
|
Luisehahne
|
<title>WebsiteBaker Installation Wizard</title>
|
150 |
1349
|
Luisehahne
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
151 |
|
|
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
|
152 |
1737
|
Luisehahne
|
<script type="text/javascript">
|
153 |
1349
|
Luisehahne
|
|
154 |
|
|
function confirm_link(message, url) {
|
155 |
|
|
if(confirm(message)) location.href = url;
|
156 |
|
|
}
|
157 |
|
|
function change_os(type) {
|
158 |
|
|
if(type == 'linux') {
|
159 |
|
|
document.getElementById('operating_system_linux').checked = true;
|
160 |
|
|
document.getElementById('operating_system_windows').checked = false;
|
161 |
1608
|
Luisehahne
|
document.getElementById('file_perms_box').style.display = 'none';
|
162 |
1349
|
Luisehahne
|
} else if(type == 'windows') {
|
163 |
|
|
document.getElementById('operating_system_linux').checked = false;
|
164 |
|
|
document.getElementById('operating_system_windows').checked = true;
|
165 |
|
|
document.getElementById('file_perms_box').style.display = 'none';
|
166 |
|
|
}
|
167 |
|
|
}
|
168 |
|
|
</script>
|
169 |
|
|
</head>
|
170 |
|
|
<body>
|
171 |
1608
|
Luisehahne
|
<div class="body">
|
172 |
|
|
<table summary="" cellpadding="0" cellspacing="0">
|
173 |
|
|
<tr style="background: #a9c9ea;">
|
174 |
|
|
<td valign="top">
|
175 |
2090
|
darkviper
|
<img src="../templates/WbTheme/images/logo.png" alt="Logo" />
|
176 |
1349
|
Luisehahne
|
</td>
|
177 |
1529
|
Luisehahne
|
<td>
|
178 |
|
|
<h1 style="border:none; margin-top:1em;font-size:150%;">Installation Wizard</h1>
|
179 |
1349
|
Luisehahne
|
</td>
|
180 |
|
|
</tr>
|
181 |
|
|
</table>
|
182 |
|
|
|
183 |
2095
|
darkviper
|
<form name="website_baker_installation_wizard" action="save.php" method="post" accept-charset="UTF-8">
|
184 |
1349
|
Luisehahne
|
<input type="hidden" name="url" value="" />
|
185 |
|
|
<input type="hidden" name="username_fieldname" value="admin_username" />
|
186 |
|
|
<input type="hidden" name="password_fieldname" value="admin_password" />
|
187 |
|
|
<input type="hidden" name="remember" id="remember" value="true" />
|
188 |
|
|
|
189 |
1608
|
Luisehahne
|
<div style="padding: 5px; text-align: center; font-weight: bold;">
|
190 |
1609
|
Luisehahne
|
Welcome to the WebsiteBaker Installation Wizard.
|
191 |
1608
|
Luisehahne
|
</div>
|
192 |
1349
|
Luisehahne
|
<?php
|
193 |
|
|
if(isset($_SESSION['message']) AND $_SESSION['message'] != '') {
|
194 |
1608
|
Luisehahne
|
?><div style="width: 700px; padding: 10px; margin-bottom: 5px; border: 1px solid #FF0000; background-color: #FFDBDB;"><b>Error:</b> <?php echo $_SESSION['message']; ?></div><?php
|
195 |
1349
|
Luisehahne
|
}
|
196 |
|
|
?>
|
197 |
1608
|
Luisehahne
|
<table summary="" cellpadding="0" cellspacing="0" border="0">
|
198 |
1349
|
Luisehahne
|
<tr>
|
199 |
1608
|
Luisehahne
|
<td colspan="6" class="step-row"><h1 class="step-row">Step 1</h1> Please check the following requirements are met before continuing...</td>
|
200 |
1349
|
Luisehahne
|
</tr>
|
201 |
|
|
<?php if($session_support != '<font class="good">Enabled</font>') { ?>
|
202 |
|
|
<tr>
|
203 |
1608
|
Luisehahne
|
<td colspan="6" class="error">Please note: PHP Session Support may appear disabled if your browser does not support cookies.</td>
|
204 |
1349
|
Luisehahne
|
</tr>
|
205 |
|
|
<?php } ?>
|
206 |
|
|
<tr>
|
207 |
2104
|
darkviper
|
<td style="color: #666666;">PHP Session Support</td>
|
208 |
1608
|
Luisehahne
|
<td>
|
209 |
2104
|
darkviper
|
<?php echo $session_support; ?>
|
210 |
|
|
?>
|
211 |
1349
|
Luisehahne
|
</td>
|
212 |
2104
|
darkviper
|
<td style="color: #666666;">
|
213 |
|
|
|
214 |
|
|
</td>
|
215 |
|
|
<td>
|
216 |
|
|
$nbsp;
|
217 |
|
|
</td>
|
218 |
1349
|
Luisehahne
|
</tr>
|
219 |
1565
|
Luisehahne
|
<tr>
|
220 |
1884
|
Luisehahne
|
<td style="color: #666666;">PHP Interface</td>
|
221 |
2030
|
Luisehahne
|
<td>
|
222 |
1884
|
Luisehahne
|
<?php
|
223 |
|
|
?><font class="good">
|
224 |
|
|
<?php echo $sapi ?>
|
225 |
|
|
</font>
|
226 |
|
|
</td>
|
227 |
2104
|
darkviper
|
<td style="color: #666666;">Server DefaultCharset</td>
|
228 |
2030
|
Luisehahne
|
<td >
|
229 |
|
|
<?php
|
230 |
1565
|
Luisehahne
|
$chrval = (($e_adc != '') && (strtolower($e_adc) != 'utf-8') ? true : false);
|
231 |
|
|
if($chrval == false) {
|
232 |
|
|
?><font class="good">
|
233 |
|
|
<?php echo (($e_adc=='') ? 'OK' : $e_adc) ?>
|
234 |
|
|
</font>
|
235 |
|
|
<?php
|
236 |
1349
|
Luisehahne
|
} else {
|
237 |
1565
|
Luisehahne
|
?><font class="bad"><?php echo $e_adc ?></font><?php
|
238 |
1349
|
Luisehahne
|
}
|
239 |
|
|
?>
|
240 |
|
|
</td>
|
241 |
|
|
</tr>
|
242 |
1565
|
Luisehahne
|
<?php if($chrval == true) {
|
243 |
1529
|
Luisehahne
|
?>
|
244 |
1349
|
Luisehahne
|
<tr>
|
245 |
1565
|
Luisehahne
|
<td colspan="6" style="font-size: 10px;" class="bad">
|
246 |
|
|
<p class="warning">
|
247 |
|
|
<b>Please note:</b> Yor webserver is configured to deliver <b><?php echo $e_adc;?></b> charset only.<br />
|
248 |
|
|
To display national special characters (e.g.: ä á) in clear manner, switch off this preset please(or let it do by your hosting provider).<br />
|
249 |
|
|
In any case you can choose <b><?php echo $e_adc;?></b> in the settings of WebsiteBaker.<br />
|
250 |
|
|
But this solution does not guarranty a correct displaying of the content from all modules!
|
251 |
|
|
</p>
|
252 |
|
|
</td>
|
253 |
1608
|
Luisehahne
|
</tr>
|
254 |
|
|
<?php } ?>
|
255 |
1884
|
Luisehahne
|
<tr>
|
256 |
|
|
<td style="line-height: 0.4em;" colspan="4"> </td>
|
257 |
|
|
</tr>
|
258 |
1608
|
Luisehahne
|
</table>
|
259 |
|
|
<table summary="" cellpadding="3" cellspacing="0">
|
260 |
|
|
<tr>
|
261 |
1654
|
Luisehahne
|
<td colspan="6" class="step-row"><h1 class="step-row">Step 2</h1> Please check the following files/folders are writeable before continuing...</td>
|
262 |
1608
|
Luisehahne
|
</tr>
|
263 |
1529
|
Luisehahne
|
<?php
|
264 |
1884
|
Luisehahne
|
$sTmp = '';
|
265 |
|
|
$config = '';
|
266 |
|
|
$sConfigFile = 'config.php.new';
|
267 |
|
|
if( ($sTmp = checkConfigFile($wb_path,'config')) === '' ) {
|
268 |
|
|
$config = '<font class="good">Writeable</font>';
|
269 |
|
|
} else {
|
270 |
|
|
$config = $sTmp;
|
271 |
1529
|
Luisehahne
|
}
|
272 |
1885
|
Luisehahne
|
$sConfigFile = preg_match('/(?:rename)/i',$config) ? $sConfigFile : 'config.php';
|
273 |
1884
|
Luisehahne
|
$installFlag = $installFlag && ($sTmp == '');
|
274 |
1529
|
Luisehahne
|
?>
|
275 |
1608
|
Luisehahne
|
<tr>
|
276 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root.$sConfigFile ?></td>
|
277 |
1802
|
Luisehahne
|
<td colspan="2"><?php echo $config ?></td>
|
278 |
|
|
</tr>
|
279 |
1884
|
Luisehahne
|
<?php
|
280 |
|
|
$sTmp = '';
|
281 |
|
|
$config = '';
|
282 |
|
|
$sSetupIniFile = 'setup.ini.php.new';
|
283 |
|
|
if( ($sTmp = checkConfigFile($wb_path,'setup.ini')) === '' ) {
|
284 |
|
|
$config = '<font class="good">Writeable</font>';
|
285 |
|
|
} else {
|
286 |
|
|
$config = $sTmp;
|
287 |
|
|
}
|
288 |
|
|
$sSetupIniFile = preg_match('/(?:rename)/i',$config) ? $sSetupIniFile : 'setup.ini.php';
|
289 |
|
|
$installFlag = $installFlag && ($sTmp == '');
|
290 |
|
|
?>
|
291 |
1802
|
Luisehahne
|
<tr>
|
292 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root.$sSetupIniFile ?></td>
|
293 |
|
|
<td colspan="2"><?php echo $config ?></td>
|
294 |
|
|
</tr>
|
295 |
|
|
<tr>
|
296 |
|
|
<td colspan="2" style="color: #666666;"><?php print $wb_root ?>pages/</td>
|
297 |
1654
|
Luisehahne
|
<td><?php if(is_writable('../pages/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists('../pages/')) {$installFlag = false; echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
|
298 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root ?>media/</td>
|
299 |
1802
|
Luisehahne
|
<td><?php if(is_writable('../media/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists('../media/')) {$installFlag = false; echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
|
300 |
1349
|
Luisehahne
|
</tr>
|
301 |
|
|
<tr>
|
302 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root ?>templates/</td>
|
303 |
1608
|
Luisehahne
|
<td><?php if(is_writable('../templates/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists('../templates/')) {$installFlag = false; echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
|
304 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root ?>modules/</td>
|
305 |
1802
|
Luisehahne
|
<td><?php if(is_writable('../modules/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists('../modules/')) {$installFlag = false; echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
|
306 |
1608
|
Luisehahne
|
</tr>
|
307 |
|
|
<tr>
|
308 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root ?>languages/</td>
|
309 |
1529
|
Luisehahne
|
<td><?php if(is_writable('../languages/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists('../languages/')) {$installFlag = false; echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
|
310 |
1884
|
Luisehahne
|
<td colspan="2" style="color: #666666;"><?php print $wb_root ?>temp/</td>
|
311 |
1529
|
Luisehahne
|
<td><?php if(is_writable('../temp/')) { echo '<font class="good">Writeable</font>'; } elseif(!file_exists('../temp/')) {$installFlag = false; echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } ?></td>
|
312 |
1349
|
Luisehahne
|
</tr>
|
313 |
1884
|
Luisehahne
|
<tr>
|
314 |
|
|
<td style="line-height: 0.4em;" colspan="4"> </td>
|
315 |
|
|
</tr>
|
316 |
1349
|
Luisehahne
|
</table>
|
317 |
1886
|
Luisehahne
|
<?php if($installFlag==true) { ?>
|
318 |
|
|
|
319 |
1608
|
Luisehahne
|
<table summary="" cellpadding="3" cellspacing="0" >
|
320 |
1349
|
Luisehahne
|
<tr>
|
321 |
1608
|
Luisehahne
|
<td colspan="2" class="step-row"><h1 class="step-row">Step 3</h1> Please check URL settings, and select a default timezone and a default backend language...</td>
|
322 |
1349
|
Luisehahne
|
</tr>
|
323 |
|
|
<tr>
|
324 |
1608
|
Luisehahne
|
<td class="name">
|
325 |
1349
|
Luisehahne
|
Absolute URL:
|
326 |
|
|
</td>
|
327 |
1608
|
Luisehahne
|
<td class="value">
|
328 |
1349
|
Luisehahne
|
<?php
|
329 |
|
|
// Try to guess installation URL
|
330 |
|
|
$guessed_url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"];
|
331 |
|
|
$guessed_url = rtrim(dirname($guessed_url), 'install');
|
332 |
|
|
?>
|
333 |
|
|
<input <?php echo field_error('wb_url');?> type="text" tabindex="1" name="wb_url" style="width: 99%;" value="<?php if(isset($_SESSION['wb_url'])) { echo $_SESSION['wb_url']; } else { echo $guessed_url; } ?>" />
|
334 |
|
|
</td>
|
335 |
|
|
</tr>
|
336 |
|
|
<tr>
|
337 |
1608
|
Luisehahne
|
<td class="name">
|
338 |
1349
|
Luisehahne
|
Default Timezone:
|
339 |
|
|
</td>
|
340 |
|
|
<td>
|
341 |
|
|
<select <?php echo field_error('default_timezone');?> tabindex="3" name="default_timezone" style="width: 100%;">
|
342 |
2104
|
darkviper
|
<?php
|
343 |
|
|
/*
|
344 |
|
|
build list of TimeZone options
|
345 |
|
|
*/
|
346 |
|
|
$aZones = array(-12,-11,-10,-9,-8,-7,-6,-5,-4,-3.5,-3,-2,-1,0,1,2,3,3.5,4,4.5,5,5.5,6,6.5,7,8,9,9.5,10,11,12,13);
|
347 |
|
|
$sOutput = PHP_EOL;
|
348 |
|
|
foreach($aZones as $fOffset) {
|
349 |
|
|
$sItemTitle = 'GMT '.(($fOffset>0)?'+':'').(($fOffset==0)?'':(string)$fOffset.' Hours');
|
350 |
|
|
$sOutput .= '<option value="'.(string)$fOffset.'"';
|
351 |
|
|
if (
|
352 |
|
|
(isset($_SESSION['default_timezone']) AND $_SESSION['default_timezone'] == (string)$fOffset) ||
|
353 |
|
|
(!isset($_SESSION['default_timezone']) AND $fOffset == 0)
|
354 |
|
|
) {
|
355 |
|
|
$sOutput .= ' selected="selected"';
|
356 |
|
|
}
|
357 |
|
|
$sOutput .= '>'.$sItemTitle.'</option>'.PHP_EOL;
|
358 |
|
|
}
|
359 |
|
|
// output Timezone options
|
360 |
|
|
echo $sOutput;
|
361 |
|
|
?>
|
362 |
1349
|
Luisehahne
|
</select>
|
363 |
|
|
</td>
|
364 |
|
|
</tr>
|
365 |
|
|
<tr>
|
366 |
1608
|
Luisehahne
|
<td class="name">
|
367 |
1349
|
Luisehahne
|
Default Language:
|
368 |
|
|
</td>
|
369 |
|
|
<td>
|
370 |
|
|
<select <?php echo field_error('default_language');?> tabindex="3" name="default_language" style="width: 100%;">
|
371 |
2104
|
darkviper
|
<?php
|
372 |
|
|
/*
|
373 |
|
|
Find all available languages in /language/ folder and build option list from
|
374 |
|
|
*/
|
375 |
|
|
$sLangDir = str_replace('\\', '/', dirname(__DIR__).'/languages/');
|
376 |
|
|
$aAvailableLanguages = InstallHelper::getAvailableLanguages($sLangDir);
|
377 |
|
|
$sOutput = PHP_EOL;
|
378 |
|
|
foreach ($aAvailableLanguages as $sLangCode => $sLangName) {
|
379 |
|
|
$sOutput .= '<option value="'.$sLangCode.'"';
|
380 |
|
|
if (
|
381 |
|
|
(isset($_SESSION['default_language']) AND $_SESSION['default_language'] == $sLangCode) ||
|
382 |
|
|
(!isset($_SESSION['default_language']) AND $sLangCode == 'EN')
|
383 |
|
|
) {
|
384 |
|
|
$sOutput .= ' selected="selected"';
|
385 |
|
|
}
|
386 |
|
|
$sOutput .= '>'.$sLangName.'</option>'.PHP_EOL;
|
387 |
|
|
}
|
388 |
|
|
// output Language options
|
389 |
|
|
echo $sOutput;
|
390 |
|
|
?>
|
391 |
1349
|
Luisehahne
|
</select>
|
392 |
|
|
</td>
|
393 |
|
|
</tr>
|
394 |
1884
|
Luisehahne
|
<tr>
|
395 |
|
|
<td style="line-height: 0.4em;" colspan="2"> </td>
|
396 |
|
|
</tr>
|
397 |
1349
|
Luisehahne
|
</table>
|
398 |
1608
|
Luisehahne
|
<table border="0" summary="" cellpadding="0" cellspacing="0">
|
399 |
1349
|
Luisehahne
|
<tr>
|
400 |
1608
|
Luisehahne
|
<td class="step-row" colspan="3"><h1 class="step-row">Step 4</h1> Please specify your operating system information below...</td>
|
401 |
1349
|
Luisehahne
|
</tr>
|
402 |
|
|
<tr>
|
403 |
1608
|
Luisehahne
|
<td class="name">
|
404 |
1349
|
Luisehahne
|
Server Operating System:
|
405 |
|
|
</td>
|
406 |
1737
|
Luisehahne
|
<td style="<?php echo $operating_system ?>">
|
407 |
|
|
<input type="radio" tabindex="4" name="operating_system" id="operating_system_linux" onclick="document.getElementById('file_perms_box').style.display = 'none';" value="linux"<?php if($operating_system == 'linux') { echo ' checked="checked"'; } ?> />
|
408 |
|
|
<span style="cursor: pointer;" onclick="javascript:change_os('linux');">Linux/Unix based</span>
|
409 |
1349
|
Luisehahne
|
<br />
|
410 |
1737
|
Luisehahne
|
<input type="radio" tabindex="5" name="operating_system" id="operating_system_windows" onclick="document.getElementById('file_perms_box').style.display = 'none';" value="windows"<?php if($operating_system == 'windows') { echo ' checked="checked"'; } ?> />
|
411 |
|
|
<span style="cursor: pointer;" onclick="javascript:change_os('windows');">Windows</span>
|
412 |
1349
|
Luisehahne
|
</td>
|
413 |
1608
|
Luisehahne
|
</tr>
|
414 |
|
|
<tr>
|
415 |
|
|
<td class="name"> </td>
|
416 |
|
|
<td class="value">
|
417 |
|
|
<div id="file_perms_box" style="line-height:2em; position: relative; width: 100%;float:left; margin: 0; padding: 0; display: <?php if(isset($_SESSION['operating_system']) AND $_SESSION['operating_system'] == 'windows') { echo 'none'; } else { echo 'none'; } ?>;">
|
418 |
|
|
<input type="checkbox" tabindex="6" name="world_writeable" id="world_writeable" value="true"<?php if(isset($_SESSION['world_writeable']) AND $_SESSION['world_writeable'] == true) { echo ' checked="checked'; } ?> />
|
419 |
|
|
<label style=" margin: 0; " for="world_writeable">
|
420 |
1349
|
Luisehahne
|
World-writeable file permissions (777)
|
421 |
|
|
</label>
|
422 |
1608
|
Luisehahne
|
<br />
|
423 |
|
|
<p class="warning">(Please note: only recommended for testing environments)</p>
|
424 |
1349
|
Luisehahne
|
</div>
|
425 |
|
|
</td>
|
426 |
|
|
</tr>
|
427 |
1884
|
Luisehahne
|
<tr>
|
428 |
|
|
<td style="line-height: 0.4em;" colspan="2"> </td>
|
429 |
|
|
</tr>
|
430 |
1349
|
Luisehahne
|
</table>
|
431 |
1608
|
Luisehahne
|
<table summary="" cellpadding="0" cellspacing="0">
|
432 |
1349
|
Luisehahne
|
<tr>
|
433 |
1608
|
Luisehahne
|
<td colspan="2" class="step-row"><h1 class="step-row">Step 5</h1> Please enter your MySQL database server details below...</td>
|
434 |
1349
|
Luisehahne
|
</tr>
|
435 |
|
|
<tr>
|
436 |
1608
|
Luisehahne
|
<td class="name">Host Name</td>
|
437 |
|
|
<td class="value">
|
438 |
|
|
<input <?php echo field_error('database_host');?> type="text" tabindex="7" name="database_host" value="<?php if(isset($_SESSION['database_host'])) { echo $_SESSION['database_host']; } else { echo 'localhost'; } ?>" />
|
439 |
1349
|
Luisehahne
|
</td>
|
440 |
|
|
</tr>
|
441 |
|
|
<tr>
|
442 |
1608
|
Luisehahne
|
<td class="name">Database Name ([a-zA-Z0-9_-])</td>
|
443 |
|
|
<td class="value">
|
444 |
|
|
<input <?php echo field_error('database_name')?> type="text" tabindex="8" name="database_name" value="<?php if(isset($_SESSION['database_name'])) { echo $_SESSION['database_name']; } else { echo 'DatabaseName'; } ?>" />
|
445 |
1349
|
Luisehahne
|
</td>
|
446 |
|
|
</tr>
|
447 |
|
|
<tr>
|
448 |
1608
|
Luisehahne
|
<td class="name">Table Prefix ([a-zA-Z0-9_])</td>
|
449 |
|
|
<td class="value">
|
450 |
1614
|
Luisehahne
|
<input <?php echo field_error('table_prefix')?> type="text" tabindex="9" name="table_prefix" value="<?php if(isset($_SESSION['table_prefix'])) { echo $_SESSION['table_prefix']; } else { echo 'wb_'; } ?>" />
|
451 |
1349
|
Luisehahne
|
</td>
|
452 |
1608
|
Luisehahne
|
</tr>
|
453 |
|
|
<tr>
|
454 |
|
|
<td class="name">Username:</td>
|
455 |
|
|
<td class="value">
|
456 |
1614
|
Luisehahne
|
<input <?php echo field_error('database_username');?> type="text" tabindex="10" name="database_username" value="<?php if(isset($_SESSION['database_username'])) { echo $_SESSION['database_username']; } else { echo 'root'; } ?>" />
|
457 |
1608
|
Luisehahne
|
</td>
|
458 |
|
|
</tr>
|
459 |
|
|
<tr>
|
460 |
|
|
<td class="name">Password:</td>
|
461 |
|
|
<td class="value">
|
462 |
1614
|
Luisehahne
|
<input type="password" tabindex="11" name="database_password" value="<?php if(isset($_SESSION['database_password'])) { echo $_SESSION['database_password']; } ?>" />
|
463 |
1608
|
Luisehahne
|
</td>
|
464 |
|
|
</tr>
|
465 |
|
|
<tr>
|
466 |
|
|
<td class="name hide" colspan="2">
|
467 |
1349
|
Luisehahne
|
<input type="checkbox" tabindex="12" name="install_tables" id="install_tables" value="true"<?php if(!isset($_SESSION['install_tables'])) { echo ' checked="checked"'; } elseif($_SESSION['install_tables'] == 'true') { echo ' checked="checked"'; } ?> />
|
468 |
|
|
<label for="install_tables" style="color: #666666;">Install Tables</label>
|
469 |
|
|
<br />
|
470 |
1608
|
Luisehahne
|
<span style="font-size: 1px; color: #666666;">(Please note: May remove existing tables and data)</span>
|
471 |
1349
|
Luisehahne
|
</td>
|
472 |
|
|
</tr>
|
473 |
1884
|
Luisehahne
|
<tr>
|
474 |
|
|
<td style="line-height: 0.4em;" colspan="2"> </td>
|
475 |
|
|
</tr>
|
476 |
1608
|
Luisehahne
|
</table>
|
477 |
|
|
<table summary="" cellpadding="0" cellspacing="0" >
|
478 |
|
|
<tbody>
|
479 |
1349
|
Luisehahne
|
<tr>
|
480 |
1608
|
Luisehahne
|
<td colspan="2" class="step-row"><h1 class="step-row">Step 6</h1> Please enter your website title below...</td>
|
481 |
1349
|
Luisehahne
|
</tr>
|
482 |
|
|
<tr>
|
483 |
1608
|
Luisehahne
|
<td class="name">Website Title:</td>
|
484 |
|
|
<td class="value">
|
485 |
|
|
<input <?php echo field_error('website_title');?> type="text" tabindex="13" name="website_title" value="<?php if(isset($_SESSION['website_title'])) { echo $_SESSION['website_title']; } else { echo 'Enter your website title'; } ?>" />
|
486 |
1349
|
Luisehahne
|
</td>
|
487 |
|
|
</tr>
|
488 |
1884
|
Luisehahne
|
<tr>
|
489 |
|
|
<td style="line-height: 0.4em;" colspan="2"> </td>
|
490 |
|
|
</tr>
|
491 |
1608
|
Luisehahne
|
</tbody>
|
492 |
|
|
</table>
|
493 |
|
|
<table summary="" cellpadding="0" cellspacing="0" border="0">
|
494 |
1349
|
Luisehahne
|
<tr>
|
495 |
1608
|
Luisehahne
|
<td colspan="2" class="step-row"><h1 class="step-row">Step 7</h1> Please enter your Administrator account details below...</td>
|
496 |
1349
|
Luisehahne
|
</tr>
|
497 |
|
|
<tr>
|
498 |
1608
|
Luisehahne
|
<td class="name">Loginname:</td>
|
499 |
|
|
<td class="value">
|
500 |
|
|
<input <?php echo field_error('admin_username');?> type="text" tabindex="14" name="admin_username" value="<?php if(isset($_SESSION['admin_username'])) { echo $_SESSION['admin_username']; } else { echo 'admin'; } ?>" />
|
501 |
1349
|
Luisehahne
|
</td>
|
502 |
1608
|
Luisehahne
|
</tr>
|
503 |
|
|
<tr>
|
504 |
|
|
<td class="name">Email:</td>
|
505 |
|
|
<td class="value">
|
506 |
|
|
<input <?php echo field_error('admin_email');?> type="text" tabindex="15" name="admin_email" value="<?php if(isset($_SESSION['admin_email'])) { echo $_SESSION['admin_email']; } ?>" />
|
507 |
1349
|
Luisehahne
|
</td>
|
508 |
|
|
</tr>
|
509 |
|
|
<tr>
|
510 |
1608
|
Luisehahne
|
<td class="name">Password:</td>
|
511 |
|
|
<td class="value">
|
512 |
2095
|
darkviper
|
<input <?php echo field_error('admin_password');?> type="password" maxlength="30" tabindex="16" name="admin_password" value="" />
|
513 |
1349
|
Luisehahne
|
</td>
|
514 |
|
|
</tr>
|
515 |
|
|
<tr>
|
516 |
1608
|
Luisehahne
|
<td class="name">Re-Password:</td>
|
517 |
|
|
<td class="value">
|
518 |
2095
|
darkviper
|
<input <?php echo field_error('admin_repassword');?> type="password" maxlength="30" tabindex="17" name="admin_repassword" value="" />
|
519 |
1608
|
Luisehahne
|
</td>
|
520 |
1349
|
Luisehahne
|
</tr>
|
521 |
1884
|
Luisehahne
|
<tr>
|
522 |
|
|
<td style="line-height: 0.4em;" colspan="2"> </td>
|
523 |
|
|
</tr>
|
524 |
1608
|
Luisehahne
|
</table>
|
525 |
1886
|
Luisehahne
|
<?php } ?>
|
526 |
|
|
|
527 |
1608
|
Luisehahne
|
<table summary="" cellpadding="0" cellspacing="0">
|
528 |
1349
|
Luisehahne
|
<tr valign="top">
|
529 |
1608
|
Luisehahne
|
<td><strong>Please note: </strong></td>
|
530 |
|
|
</tr>
|
531 |
|
|
<tr valign="top">
|
532 |
1349
|
Luisehahne
|
<td>
|
533 |
1608
|
Luisehahne
|
<p class="warning">
|
534 |
1609
|
Luisehahne
|
WebsiteBaker is released under the
|
535 |
1349
|
Luisehahne
|
<a href="http://www.gnu.org/licenses/gpl.html" target="_blank" tabindex="19">GNU General Public License</a>
|
536 |
|
|
<br />
|
537 |
|
|
By clicking install, you are accepting the license.
|
538 |
1608
|
Luisehahne
|
</p>
|
539 |
1349
|
Luisehahne
|
</td>
|
540 |
|
|
</tr>
|
541 |
1608
|
Luisehahne
|
<tr valign="top">
|
542 |
|
|
<td>
|
543 |
|
|
<p class="center">
|
544 |
1529
|
Luisehahne
|
<?php if($installFlag == true) { ?>
|
545 |
1608
|
Luisehahne
|
<input type="submit" tabindex="20" name="install" value="Install WebsiteBaker" />
|
546 |
1529
|
Luisehahne
|
<?php } else { ?>
|
547 |
1608
|
Luisehahne
|
<input type="button" tabindex="20" name="restart" value="Check your Settings in Step1 or Step2" class="submit" onclick="javascript: window.location = '<?php print $_SERVER['SCRIPT_NAME'] ?>';" />
|
548 |
1529
|
Luisehahne
|
<?php } ?>
|
549 |
1608
|
Luisehahne
|
</p>
|
550 |
1349
|
Luisehahne
|
</td>
|
551 |
|
|
</tr>
|
552 |
|
|
</table>
|
553 |
|
|
|
554 |
|
|
</form>
|
555 |
|
|
|
556 |
1608
|
Luisehahne
|
<div style="padding: 10px 0px 10px 0px; text-align:center;">
|
557 |
1349
|
Luisehahne
|
<!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
|
558 |
1614
|
Luisehahne
|
<a href="http://www.websitebaker.org/" style="color: #000000;" target="_blank">WebsiteBaker</a>
|
559 |
1349
|
Luisehahne
|
is released under the
|
560 |
|
|
<a href="http://www.gnu.org/licenses/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a>
|
561 |
|
|
<!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
|
562 |
1608
|
Luisehahne
|
</div >
|
563 |
|
|
</div>
|
564 |
1349
|
Luisehahne
|
|
565 |
|
|
</body>
|
566 |
|
|
</html>
|