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