Project

General

Profile

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
36 1349 Luisehahne
// Start a session
37
if(!defined('SESSION_STARTED')) {
38
	session_name('wb_session_id');
39
	session_start();
40
	define('SESSION_STARTED', true);
41
}
42
43 1884 Luisehahne
$doc_root = str_replace('\\','/',rtrim(realpath($_SERVER['DOCUMENT_ROOT']),'/').'/');
44
$wb_path = str_replace('\\','/',rtrim(dirname(dirname(realpath( __FILE__))),'/')).'/';
45
$wb_root = str_replace(($doc_root),'',$wb_path);
46 1530 Luisehahne
47 1349 Luisehahne
// Function to highlight input fields which contain wrong/missing data
48
function field_error($field_name='') {
49
	if(!defined('SESSION_STARTED') || $field_name == '') return;
50
	if(isset($_SESSION['ERROR_FIELD']) && $_SESSION['ERROR_FIELD'] == $field_name) {
51
		return ' class="wrong"';
52
	}
53
}
54
55 1529 Luisehahne
$installFlag = true;
56 1349 Luisehahne
// Check if the page has been reloaded
57
if(!isset($_GET['sessions_checked']) OR $_GET['sessions_checked'] != 'true') {
58
	// Set session variable
59
	$_SESSION['session_support'] = '<font class="good">Enabled</font>';
60
	// Reload page
61
	header('Location: index.php?sessions_checked=true');
62
	exit(0);
63
} else {
64
	// Check if session variable has been saved after reload
65
	if(isset($_SESSION['session_support'])) {
66
		$session_support = $_SESSION['session_support'];
67 1529 Luisehahne
	} else {
68
		$installFlag = false;
69 1349 Luisehahne
		$session_support = '<font class="bad">Disabled</font>';
70
	}
71
}
72 2030 Luisehahne
$getMagicQuotesGpc = '<font class="good">Disabled</font>';
73
if ( function_exists('get_magic_quotes_gpc')  && filter_var(strtolower(get_magic_quotes_gpc()), FILTER_VALIDATE_BOOLEAN ) ) {
74
    $getMagicQuotesGpc = '<font class="bad">Enabled</font>';
75
    $installFlag = false;
76
}
77
78 1349 Luisehahne
// Check if AddDefaultCharset is set
79
$e_adc=false;
80
$sapi=php_sapi_name();
81
if(strpos($sapi, 'apache')!==FALSE || strpos($sapi, 'nsapi')!==FALSE) {
82
	flush();
83
	$apache_rheaders=apache_response_headers();
84
	foreach($apache_rheaders AS $h) {
85
		if(strpos($h, 'html; charset')!==FALSE) {
86
			preg_match('/charset\s*=\s*([a-zA-Z0-9- _]+)/', $h, $match);
87
			$apache_charset=$match[1];
88
			$e_adc=$apache_charset;
89
		}
90
	}
91
}
92
93 1884 Luisehahne
//$sapi_type = php_sapi_name();
94 1737 Luisehahne
if(!isset($_SESSION['operating_system'])) {
95 1884 Luisehahne
	$operating_system = ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'windows' : 'linux');
96 1737 Luisehahne
} else {
97 1884 Luisehahne
	$operating_system = $_SESSION['operating_system'];
98 1737 Luisehahne
}
99 1884 Luisehahne
100
function checkConfigFile ($sWbPath,$sType ) {
101
	$config = '';
102
	$sConfigContent	= "<?php\n";
103
	$sConfigFile = $sWbPath.$sType.'.php';
104
105
// config.php or config.php.new
106 2030 Luisehahne
		if ((file_exists($sConfigFile)==true)) {
107 1884 Luisehahne
// next operation only if file is writeable
108 2030 Luisehahne
			if (is_writeable($sConfigFile)) {
109 1884 Luisehahne
// already installed? it's not empty
110 2030 Luisehahne
				if (filesize($sConfigFile) > 100) {
111 1884 Luisehahne
					$config = '<font class="bad">Already installed? Check!</font>';
112
// try to open and to write
113 2030 Luisehahne
				} elseif (!$handle = fopen($sConfigFile, 'w')) {
114 1884 Luisehahne
					$config = '<font class="bad">Not Writeable</font>';
115
				} else {
116
					if (fwrite($handle, $sConfigContent) === FALSE) {
117
						$config = '<font class="bad">Not Writeable</font>';
118
					} else {
119
						$config = '';
120
						$_SESSION[$sType.'_rename'] = true;
121
					}
122
					// Close file
123
					fclose($handle);
124 2030 Luisehahne
				}
125 1884 Luisehahne
			} else {
126
				$config = '<font class="bad">Not Writeable</font>';
127
			}
128
// it's config.php.new
129 2030 Luisehahne
		} elseif ((file_exists($sConfigFile.'.new')==true)) {
130 1884 Luisehahne
			$config = '<font class="bad">Please rename to '.$sType.'.php</font>';
131
		} else {
132
			$config = '<font class="bad">Missing!!?</font>';
133
		}
134
	return $config;
135
}
136
137
138 1529 Luisehahne
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
139 1349 Luisehahne
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
140
<head>
141 1609 Luisehahne
<title>WebsiteBaker Installation Wizard</title>
142 1349 Luisehahne
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
143
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
144 1737 Luisehahne
<script type="text/javascript">
145 1349 Luisehahne
146
function confirm_link(message, url) {
147
	if(confirm(message)) location.href = url;
148
}
149
function change_os(type) {
150
	if(type == 'linux') {
151
		document.getElementById('operating_system_linux').checked = true;
152
		document.getElementById('operating_system_windows').checked = false;
153 1608 Luisehahne
		document.getElementById('file_perms_box').style.display = 'none';
154 1349 Luisehahne
	} else if(type == 'windows') {
155
		document.getElementById('operating_system_linux').checked = false;
156
		document.getElementById('operating_system_windows').checked = true;
157
		document.getElementById('file_perms_box').style.display = 'none';
158
	}
159
}
160
</script>
161
</head>
162
<body>
163 1608 Luisehahne
<div class="body">
164
<table summary="" cellpadding="0" cellspacing="0">
165
<tr style="background: #a9c9ea;">
166
	<td valign="top">
167 1349 Luisehahne
		<img src="../templates/wb_theme/images/logo.png" alt="Logo" />
168
	</td>
169 1529 Luisehahne
	<td>
170
		<h1 style="border:none; margin-top:1em;font-size:150%;">Installation Wizard</h1>
171 1349 Luisehahne
	</td>
172
</tr>
173
</table>
174
175
<form name="website_baker_installation_wizard" action="save.php" method="post">
176
<input type="hidden" name="url" value="" />
177
<input type="hidden" name="username_fieldname" value="admin_username" />
178
<input type="hidden" name="password_fieldname" value="admin_password" />
179
<input type="hidden" name="remember" id="remember" value="true" />
180
181 1608 Luisehahne
		<div style="padding: 5px; text-align: center; font-weight: bold;">
182 1609 Luisehahne
			Welcome to the WebsiteBaker Installation Wizard.
183 1608 Luisehahne
		</div>
184 1349 Luisehahne
		<?php
185
		if(isset($_SESSION['message']) AND $_SESSION['message'] != '') {
186 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
187 1349 Luisehahne
		}
188
		?>
189 1608 Luisehahne
		<table summary="" cellpadding="0" cellspacing="0" border="0">
190 1349 Luisehahne
		<tr>
191 1608 Luisehahne
			<td colspan="6" class="step-row"><h1 class="step-row">Step 1</h1>&nbsp;Please check the following requirements are met before continuing...</td>
192 1349 Luisehahne
		</tr>
193
		<?php if($session_support != '<font class="good">Enabled</font>') { ?>
194
		<tr>
195 1608 Luisehahne
			<td colspan="6" class="error">Please note: PHP Session Support may appear disabled if your browser does not support cookies.</td>
196 1349 Luisehahne
		</tr>
197
		<?php } ?>
198
		<tr>
199 2030 Luisehahne
			<td style="color: #666666;">PHP Version 5.3.2 and up</td>
200 1608 Luisehahne
			<td>
201 1349 Luisehahne
				<?php
202 2030 Luisehahne
			   if (version_compare(PHP_VERSION, '5.3.2', '>='))
203 1349 Luisehahne
			   {
204
					?><font class="good">Yes</font><?php
205
				} else {
206 1529 Luisehahne
					$installFlag = false;
207 1349 Luisehahne
					?><font class="bad">No</font><?php
208
				}
209
				?>
210
			</td>
211 1608 Luisehahne
			<td style="color: #666666;">PHP Session Support</td>
212
			<td><?php echo $session_support; ?></td>
213 1349 Luisehahne
		</tr>
214 1565 Luisehahne
	<tr>
215 1884 Luisehahne
		<td style="color: #666666;">PHP Interface</td>
216 2030 Luisehahne
			<td>
217 1884 Luisehahne
				<?php
218
						?><font class="good">
219
						<?php echo $sapi ?>
220
						</font>
221
			</td>
222 2030 Luisehahne
		<td style="color: #666666;">magic_quotes_gpc</td>
223
			<td >
224
				<?php
225
						?><font class="good">
226
						<?php echo $getMagicQuotesGpc ?>
227
						</font>
228
			</td>
229
230 1884 Luisehahne
		</tr>
231
232 1608 Luisehahne
		<td style="color: #666666;">Server DefaultCharset</td>
233
			<td>
234 1349 Luisehahne
				<?php
235 1565 Luisehahne
					$chrval = (($e_adc != '') && (strtolower($e_adc) != 'utf-8') ? true : false);
236
					if($chrval == false) {
237
						?><font class="good">
238
						<?php echo (($e_adc=='') ? 'OK' : $e_adc) ?>
239
						</font>
240
						<?php
241 1349 Luisehahne
					} else {
242 1565 Luisehahne
						?><font class="bad"><?php echo $e_adc ?></font><?php
243 1349 Luisehahne
					}
244 1565 Luisehahne
245 1349 Luisehahne
				?>
246
			</td>
247 1608 Luisehahne
			<td style="color: #666666;">PHP Safe Mode</td>
248
			<td>
249
				<?php
250
				if(ini_get('safe_mode')=='' || strpos(strtolower(ini_get('safe_mode')), 'off')!==FALSE || ini_get('safe_mode')==0) {
251
					?><font class="good">Disabled</font><?php
252
				} else {
253
					$installFlag = false;
254
					?><font class="bad">Enabled</font><?php
255
				}
256
				?>
257
			</td>
258 1349 Luisehahne
		</tr>
259 1565 Luisehahne
		<?php if($chrval == true) {
260 1529 Luisehahne
		?>
261 1349 Luisehahne
		<tr>
262 1565 Luisehahne
			<td colspan="6" style="font-size: 10px;" class="bad">
263
<p class="warning">
264
<b>Please note:</b> Yor webserver is configured to deliver <b><?php echo $e_adc;?></b> charset only.<br />
265
To display national special characters (e.g.: &auml; &aacute;) in clear manner, switch off this preset please(or let it do by your hosting provider).<br />
266
In any case you can choose <b><?php echo $e_adc;?></b> in the settings of WebsiteBaker.<br />
267
But this solution does not guarranty a correct displaying of the content from all modules!
268
</p>
269
</td>
270 1608 Luisehahne
</tr>
271
<?php } ?>
272 1884 Luisehahne
<tr>
273
	<td style="line-height: 0.4em;" colspan="4">&nbsp;</td>
274
</tr>
275 1608 Luisehahne
</table>
276
<table summary="" cellpadding="3" cellspacing="0">
277
<tr>
278 1654 Luisehahne
	<td colspan="6" class="step-row"><h1 class="step-row">Step 2</h1>&nbsp;Please check the following files/folders are writeable before continuing...</td>
279 1608 Luisehahne
</tr>
280 1529 Luisehahne
<?php
281 1884 Luisehahne
	$sTmp = '';
282
	$config = '';
283
	$sConfigFile = 'config.php.new';
284
	if( ($sTmp = checkConfigFile($wb_path,'config')) === '' ) {
285
		$config = '<font class="good">Writeable</font>';
286
	} else {
287
		$config = $sTmp;
288 1529 Luisehahne
	}
289 1885 Luisehahne
	$sConfigFile = preg_match('/(?:rename)/i',$config) ? $sConfigFile : 'config.php';
290 1884 Luisehahne
	$installFlag = $installFlag && ($sTmp == '');
291 1529 Luisehahne
?>
292 1608 Luisehahne
		<tr>
293 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root.$sConfigFile ?></td>
294 1802 Luisehahne
			<td colspan="2"><?php echo $config ?></td>
295
		</tr>
296 1884 Luisehahne
<?php
297
	$sTmp = '';
298
	$config = '';
299
	$sSetupIniFile = 'setup.ini.php.new';
300
	if( ($sTmp = checkConfigFile($wb_path,'setup.ini')) === '' ) {
301
		$config = '<font class="good">Writeable</font>';
302
	} else {
303
		$config = $sTmp;
304
	}
305
	$sSetupIniFile = preg_match('/(?:rename)/i',$config) ? $sSetupIniFile : 'setup.ini.php';
306
	$installFlag = $installFlag && ($sTmp == '');
307
?>
308 1802 Luisehahne
		<tr>
309 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root.$sSetupIniFile ?></td>
310
			<td colspan="2"><?php echo $config ?></td>
311
		</tr>
312
		<tr>
313
			<td colspan="2" style="color: #666666;"><?php print $wb_root ?>pages/</td>
314 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>
315 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root ?>media/</td>
316 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>
317 1349 Luisehahne
		</tr>
318
		<tr>
319 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root ?>templates/</td>
320 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>
321 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root ?>modules/</td>
322 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>
323 1608 Luisehahne
		</tr>
324
		<tr>
325 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root ?>languages/</td>
326 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>
327 1884 Luisehahne
			<td colspan="2" style="color: #666666;"><?php print $wb_root ?>temp/</td>
328 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>
329 1349 Luisehahne
		</tr>
330 1884 Luisehahne
		<tr>
331
			<td style="line-height: 0.4em;" colspan="4">&nbsp;</td>
332
		</tr>
333 1349 Luisehahne
		</table>
334 1886 Luisehahne
<?php if($installFlag==true) { ?>
335
336 1608 Luisehahne
		<table summary="" cellpadding="3" cellspacing="0" >
337 1349 Luisehahne
		<tr>
338 1608 Luisehahne
			<td colspan="2" class="step-row"><h1 class="step-row">Step 3</h1>&nbsp;Please check URL settings, and select a default timezone and a default backend language...</td>
339 1349 Luisehahne
		</tr>
340
		<tr>
341 1608 Luisehahne
			<td class="name">
342 1349 Luisehahne
				Absolute URL:
343
			</td>
344 1608 Luisehahne
			<td class="value">
345 1349 Luisehahne
				<?php
346
				// Try to guess installation URL
347
				$guessed_url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"];
348
				$guessed_url = rtrim(dirname($guessed_url), 'install');
349
				?>
350
				<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; } ?>" />
351
			</td>
352
		</tr>
353
		<tr>
354 1608 Luisehahne
			<td class="name">
355 1349 Luisehahne
				Default Timezone:
356
			</td>
357
			<td>
358
				<select <?php echo field_error('default_timezone');?> tabindex="3" name="default_timezone" style="width: 100%;">
359
					<?php
360
					$TIMEZONES['-12'] = 'GMT - 12 Hours';
361
					$TIMEZONES['-11'] = 'GMT -11 Hours';
362
					$TIMEZONES['-10'] = 'GMT -10 Hours';
363
					$TIMEZONES['-9'] = 'GMT -9 Hours';
364
					$TIMEZONES['-8'] = 'GMT -8 Hours';
365
					$TIMEZONES['-7'] = 'GMT -7 Hours';
366
					$TIMEZONES['-6'] = 'GMT -6 Hours';
367
					$TIMEZONES['-5'] = 'GMT -5 Hours';
368
					$TIMEZONES['-4'] = 'GMT -4 Hours';
369
					$TIMEZONES['-3.5'] = 'GMT -3.5 Hours';
370
					$TIMEZONES['-3'] = 'GMT -3 Hours';
371
					$TIMEZONES['-2'] = 'GMT -2 Hours';
372
					$TIMEZONES['-1'] = 'GMT -1 Hour';
373
					$TIMEZONES['0'] = 'GMT';
374
					$TIMEZONES['1'] = 'GMT +1 Hour';
375
					$TIMEZONES['2'] = 'GMT +2 Hours';
376
					$TIMEZONES['3'] = 'GMT +3 Hours';
377
					$TIMEZONES['3.5'] = 'GMT +3.5 Hours';
378
					$TIMEZONES['4'] = 'GMT +4 Hours';
379
					$TIMEZONES['4.5'] = 'GMT +4.5 Hours';
380
					$TIMEZONES['5'] = 'GMT +5 Hours';
381
					$TIMEZONES['5.5'] = 'GMT +5.5 Hours';
382
					$TIMEZONES['6'] = 'GMT +6 Hours';
383
					$TIMEZONES['6.5'] = 'GMT +6.5 Hours';
384
					$TIMEZONES['7'] = 'GMT +7 Hours';
385
					$TIMEZONES['8'] = 'GMT +8 Hours';
386
					$TIMEZONES['9'] = 'GMT +9 Hours';
387
					$TIMEZONES['9.5'] = 'GMT +9.5 Hours';
388
					$TIMEZONES['10'] = 'GMT +10 Hours';
389
					$TIMEZONES['11'] = 'GMT +11 Hours';
390
					$TIMEZONES['12'] = 'GMT +12 Hours';
391
					$TIMEZONES['13'] = 'GMT +13 Hours';
392
					foreach($TIMEZONES AS $hour_offset => $title) {
393
						?>
394
							<option value="<?php echo $hour_offset; ?>"<?php if(isset($_SESSION['default_timezone']) AND $_SESSION['default_timezone'] == $hour_offset) { echo ' selected="selected"'; } elseif(!isset($_SESSION['default_timezone']) AND $hour_offset == 0) { echo ' selected="selected"'; } ?>><?php echo $title; ?></option>
395
						<?php
396
					}
397
					?>
398
				</select>
399
			</td>
400
		</tr>
401
		<tr>
402 1608 Luisehahne
			<td class="name">
403 1349 Luisehahne
				Default Language:
404
			</td>
405
			<td>
406
				<select <?php echo field_error('default_language');?> tabindex="3" name="default_language" style="width: 100%;">
407
					<?php
408 1737 Luisehahne
                	$sAutoLanguage = 'EN'; // default, if no information from client available
409
                	if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
410
                		if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) {
411
                			$sAutoLanguage = strtoupper($matches[1]);
412
                		}
413
                	}
414
                	$sAutoLanguage = isset($_SESSION['default_language']) ? $_SESSION['default_language'] : $sAutoLanguage;
415 1349 Luisehahne
					$DEFAULT_LANGUAGE = array(
416
						'BG'=>'Bulgarian', 'CA'=>'Catalan', 'CS'=>'&#268;e&scaron;tina', 'DA'=>'Danish', 'DE'=>'Deutsch', 'EN'=>'English',
417
						'ES'=>'Spanish', 'ET'=>'Eesti', 'FI'=>'Suomi', 'FR'=>'Fran&ccedil;ais',
418
						'HR'=>'Hrvatski', 'HU'=>'Magyar','IT'=>'Italiano', 'LV'=>'Latviesu',
419
						'NL'=>'Nederlands', 'NO'=>'Norsk', 'PL'=>'Polski', 'PT'=>'Portuguese (Brazil)', 'RU'=>'Russian', 'SE'=>'Svenska','SK'=>'Slovensky','TR'=>'Turkish'
420
					);
421
					foreach($DEFAULT_LANGUAGE as $lang_id => $lang_title) {
422
						?>
423 1737 Luisehahne
							<option value="<?php echo $lang_id; ?>"<?php if($sAutoLanguage == $lang_id) { echo ' selected="selected"'; }  ?> ><?php echo $lang_title; ?></option>
424 1349 Luisehahne
						<?php
425
					}
426
					?>
427
				</select>
428
			</td>
429
		</tr>
430 1884 Luisehahne
		<tr>
431
			<td style="line-height: 0.4em;" colspan="2">&nbsp;</td>
432
		</tr>
433 1349 Luisehahne
		</table>
434 1608 Luisehahne
		<table border="0" summary="" cellpadding="0" cellspacing="0">
435 1349 Luisehahne
		<tr>
436 1608 Luisehahne
			<td class="step-row" colspan="3"><h1 class="step-row">Step 4</h1>&nbsp;Please specify your operating system information below...</td>
437 1349 Luisehahne
		</tr>
438
		<tr>
439 1608 Luisehahne
			<td class="name">&nbsp;
440 1349 Luisehahne
				Server Operating System:
441
			</td>
442 1737 Luisehahne
			<td style="<?php echo $operating_system ?>">
443
				<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"'; } ?> />
444
				<span style="cursor: pointer;" onclick="javascript:change_os('linux');">Linux/Unix based</span>
445 1349 Luisehahne
				<br />
446 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"'; } ?> />
447
				<span style="cursor: pointer;" onclick="javascript:change_os('windows');">Windows</span>
448 1349 Luisehahne
			</td>
449 1608 Luisehahne
		</tr>
450
		<tr>
451
			<td class="name">&nbsp;</td>
452
			<td class="value">
453
				<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'; } ?>;">
454
					<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'; } ?> />
455
 					<label style=" margin: 0;  " for="world_writeable">
456 1349 Luisehahne
						World-writeable file permissions (777)
457
					</label>
458 1608 Luisehahne
				<br />
459
					<p class="warning">(Please note: only recommended for testing environments)</p>
460 1349 Luisehahne
				</div>
461
			</td>
462
		</tr>
463 1884 Luisehahne
		<tr>
464
			<td style="line-height: 0.4em;" colspan="2">&nbsp;</td>
465
		</tr>
466 1349 Luisehahne
		</table>
467 1608 Luisehahne
		<table summary="" cellpadding="0" cellspacing="0">
468 1349 Luisehahne
    		<tr>
469 1608 Luisehahne
    			<td colspan="2" class="step-row"><h1 class="step-row">Step 5</h1>&nbsp;Please enter your MySQL database server details below...</td>
470 1349 Luisehahne
    		</tr>
471
    		<tr>
472 1608 Luisehahne
    			<td class="name">Host Name</td>
473
    			<td class="value">
474
    				<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'; } ?>" />
475 1349 Luisehahne
    			</td>
476
    		</tr>
477
    		<tr>
478 1608 Luisehahne
    			<td class="name">Database Name&nbsp;([a-zA-Z0-9_-])</td>
479
    			<td class="value">
480
    				<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'; } ?>" />
481 1349 Luisehahne
    			</td>
482
    		</tr>
483
		<tr>
484 1608 Luisehahne
			<td class="name">Table Prefix&nbsp;([a-zA-Z0-9_])</td>
485
			<td class="value">
486 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_'; } ?>" />
487 1349 Luisehahne
			</td>
488 1608 Luisehahne
		</tr>
489
		<tr>
490
    			<td class="name">Username:</td>
491
    			<td class="value">
492 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'; } ?>" />
493 1608 Luisehahne
    			</td>
494
		</tr>
495
		<tr>
496
    			<td class="name">Password:</td>
497
    			<td class="value">
498 1614 Luisehahne
    				<input type="password" tabindex="11" name="database_password" value="<?php if(isset($_SESSION['database_password'])) { echo $_SESSION['database_password']; } ?>" />
499 1608 Luisehahne
    			</td>
500
		</tr>
501
		<tr>
502
			<td class="name hide" colspan="2">
503 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"'; } ?> />
504
				<label for="install_tables" style="color: #666666;">Install Tables</label>
505
				<br />
506 1608 Luisehahne
				<span style="font-size: 1px; color: #666666;">(Please note: May remove existing tables and data)</span>
507 1349 Luisehahne
			</td>
508
		</tr>
509 1884 Luisehahne
		<tr>
510
			<td style="line-height: 0.4em;" colspan="2">&nbsp;</td>
511
		</tr>
512 1608 Luisehahne
		</table>
513
		<table summary="" cellpadding="0" cellspacing="0" >
514
		<tbody>
515 1349 Luisehahne
		<tr>
516 1608 Luisehahne
			<td colspan="2" class="step-row"><h1 class="step-row">Step 6</h1>&nbsp;Please enter your website title below...</td>
517 1349 Luisehahne
		</tr>
518
		<tr>
519 1608 Luisehahne
			<td class="name">Website Title:</td>
520
			<td class="value">
521
				<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'; } ?>" />
522 1349 Luisehahne
			</td>
523
		</tr>
524 1884 Luisehahne
		<tr>
525
			<td style="line-height: 0.4em;" colspan="2">&nbsp;</td>
526
		</tr>
527 1608 Luisehahne
		</tbody>
528
		</table>
529
		<table summary="" cellpadding="0" cellspacing="0" border="0">
530 1349 Luisehahne
		<tr>
531 1608 Luisehahne
			<td colspan="2" class="step-row"><h1 class="step-row">Step 7</h1> Please enter your Administrator account details below...</td>
532 1349 Luisehahne
		</tr>
533
		<tr>
534 1608 Luisehahne
			<td class="name">Loginname:</td>
535
			<td class="value">
536
				<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'; } ?>" />
537 1349 Luisehahne
			</td>
538 1608 Luisehahne
		</tr>
539
		<tr>
540
			<td class="name">Email:</td>
541
			<td class="value">
542
				<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']; } ?>" />
543 1349 Luisehahne
			</td>
544
		</tr>
545
		<tr>
546 1608 Luisehahne
			<td class="name">Password:</td>
547
			<td class="value">
548
				<input <?php echo field_error('admin_password');?> type="password" tabindex="16" name="admin_password" value="" />
549 1349 Luisehahne
			</td>
550
		</tr>
551
		<tr>
552 1608 Luisehahne
			<td class="name">Re-Password:</td>
553
			<td class="value">
554
				<input <?php echo field_error('admin_repassword');?> type="password" tabindex="17" name="admin_repassword" value=""  />
555
			</td>
556 1349 Luisehahne
		</tr>
557 1884 Luisehahne
		<tr>
558
			<td style="line-height: 0.4em;" colspan="2">&nbsp;</td>
559
		</tr>
560 1608 Luisehahne
		</table>
561 1886 Luisehahne
<?php } ?>
562
563 1608 Luisehahne
		<table summary="" cellpadding="0" cellspacing="0">
564 1349 Luisehahne
				<tr valign="top">
565 1608 Luisehahne
					<td><strong>Please note: &nbsp;</strong></td>
566
				</tr>
567
				<tr valign="top">
568 1349 Luisehahne
					<td>
569 1608 Luisehahne
						<p class="warning">
570 1609 Luisehahne
						WebsiteBaker is released under the
571 1349 Luisehahne
						<a href="http://www.gnu.org/licenses/gpl.html" target="_blank" tabindex="19">GNU General Public License</a>
572
						<br />
573
						By clicking install, you are accepting the license.
574 1608 Luisehahne
						</p>
575 1349 Luisehahne
					</td>
576
				</tr>
577 1608 Luisehahne
				<tr valign="top">
578
			<td>
579
			<p class="center">
580 1529 Luisehahne
				<?php if($installFlag == true) { ?>
581 1608 Luisehahne
				<input type="submit" tabindex="20" name="install" value="Install WebsiteBaker" />
582 1529 Luisehahne
				<?php } else { ?>
583 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'] ?>';" />
584 1529 Luisehahne
				<?php } ?>
585 1608 Luisehahne
			</p>
586 1349 Luisehahne
			</td>
587
		</tr>
588
		</table>
589
590
</form>
591
592 1608 Luisehahne
	<div style="padding: 10px 0px 10px 0px; text-align:center;">
593 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. -->
594 1614 Luisehahne
		<a href="http://www.websitebaker.org/" style="color: #000000;" target="_blank">WebsiteBaker</a>
595 1349 Luisehahne
		is	released under the
596
		<a href="http://www.gnu.org/licenses/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a>
597
		<!-- 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. -->
598 1608 Luisehahne
	</div >
599
</div>
600 1349 Luisehahne
601
</body>
602
</html>