Completed
Push — master ( 94d96f...9f9db9 )
by Yannick
29:42
created
install/index.php 2 patches
Spacing   +281 added lines, -281 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 require_once(dirname(__FILE__).'/class.create_db.php');
23 23
 require_once(dirname(__FILE__).'/class.update_schema.php');
24 24
 require_once(dirname(__FILE__).'/class.settings.php');
25
-$title="Install";
25
+$title = "Install";
26 26
 require(dirname(__FILE__).'/../require/settings.php');
27 27
 require_once(dirname(__FILE__).'/../require/class.Common.php');
28 28
 require(dirname(__FILE__).'/header.php');
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	if (!extension_loaded('curl')) {
96 96
 		$error[] = "Curl is not loaded.";
97 97
 	}
98
-	if(function_exists('apache_get_modules') ){
99
-		if(!in_array('mod_rewrite',apache_get_modules())) {
98
+	if (function_exists('apache_get_modules')) {
99
+		if (!in_array('mod_rewrite', apache_get_modules())) {
100 100
 			$error[] = "mod_rewrite is not available.";
101 101
 		}
102 102
 	/*
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
113 113
 	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
114 114
 		if (function_exists('get_headers')) {
115
-			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
116
-			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
115
+			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
116
+			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
117 117
 				print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
118 118
 			}
119 119
 		}
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
 ?>
506 506
 							<tr>
507 507
 								<?php
508
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
508
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
509 509
 								?>
510 510
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
511 511
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
512 512
 								<?php
513 513
 								    } else {
514
-									$hostport = explode(':',$source['host']);
514
+									$hostport = explode(':', $source['host']);
515 515
 									if (isset($hostport[1])) {
516 516
 										$host = $hostport[0];
517 517
 										$port = $hostport[1];
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 									<select name="timezones[]" id="timezones">
561 561
 								<?php
562 562
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
563
-									foreach($timezonelist as $timezones){
563
+									foreach ($timezonelist as $timezones) {
564 564
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
565 565
 											print '<option selected>'.$timezones.'</option>';
566 566
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 									<select name="timezones[]" id="timezones">
615 615
 								<?php
616 616
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
617
-									foreach($timezonelist as $timezones){
617
+									foreach ($timezonelist as $timezones) {
618 618
 										if ($timezones == 'UTC') {
619 619
 											print '<option selected>'.$timezones.'</option>';
620 620
 										} else print '<option>'.$timezones.'</option>';
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 			<br />
1067 1067
 			<p>
1068 1068
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1069
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1069
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
1070 1070
 			</p>
1071 1071
 			<br />
1072 1072
 			<p>
@@ -1128,14 +1128,14 @@  discard block
 block discarded – undo
1128 1128
 $error = '';
1129 1129
 
1130 1130
 if (isset($_POST['dbtype'])) {
1131
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
1132
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
1133
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
1134
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
1135
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
1136
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
1137
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1138
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1131
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
1132
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
1133
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
1134
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
1135
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
1136
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
1137
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
1138
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
1139 1139
 
1140 1140
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1141 1141
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -1155,49 +1155,49 @@  discard block
 block discarded – undo
1155 1155
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1156 1156
 	*/
1157 1157
 	
1158
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1158
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
1159 1159
 
1160
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
1161
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
1162
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
1163
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
1164
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
1160
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
1161
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
1162
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
1163
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
1164
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
1165 1165
 
1166
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
1167
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
1168
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
1169
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
1170
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
1171
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
1172
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
1173
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
1174
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
1175
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
1166
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
1167
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
1168
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
1169
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
1170
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
1171
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
1172
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
1173
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
1174
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
1175
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
1176 1176
 	
1177
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
1178
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
1179
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
1180
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
1181
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
1182
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
1177
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
1178
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
1179
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
1180
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
1181
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
1182
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
1183 1183
 
1184
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
1185
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
1184
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
1185
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
1186 1186
 
1187
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
1188
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
1189
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
1187
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
1188
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
1189
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
1190 1190
 
1191
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
1191
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
1192 1192
 	if ($acars == 'acars') {
1193
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
1193
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
1194 1194
 	} else {
1195
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
1195
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
1196 1196
 	}
1197 1197
 
1198
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
1199
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
1200
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
1198
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
1199
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
1200
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
1201 1201
 	
1202 1202
 	$source_name = $_POST['source_name'];
1203 1203
 	$source_latitude = $_POST['source_latitude'];
@@ -1211,8 +1211,8 @@  discard block
 block discarded – undo
1211 1211
 	
1212 1212
 	$sources = array();
1213 1213
 	foreach ($source_name as $keys => $name) {
1214
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1215
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1214
+	    if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]);
1215
+	    else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]);
1216 1216
 	}
1217 1217
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1218 1218
 
@@ -1221,16 +1221,16 @@  discard block
 block discarded – undo
1221 1221
 	$newstype = $_POST['newstype'];
1222 1222
 	
1223 1223
 	$newsfeeds = array();
1224
-	foreach($newsurl as $newskey => $url) {
1224
+	foreach ($newsurl as $newskey => $url) {
1225 1225
 	    if ($url != '') {
1226 1226
 		$type = $newstype[$newskey];
1227 1227
 		$lng = $newslng[$newskey];
1228 1228
 		if (isset($newsfeeds[$type][$lng])) {
1229
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1229
+		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));
1230 1230
 		} else $newsfeeds[$type][$lng] = array($url);
1231 1231
 	    }
1232 1232
 	}
1233
-	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1233
+	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds));
1234 1234
 
1235 1235
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1236 1236
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1241,27 +1241,27 @@  discard block
 block discarded – undo
1241 1241
 	$sbsurl = $_POST['sbsurl'];
1242 1242
 	*/
1243 1243
 
1244
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1245
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1246
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1247
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1248
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1249
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1250
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1251
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1244
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1245
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1246
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1247
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1248
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1249
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1250
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1251
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1252 1252
 
1253
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1254
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1255
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1256
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1257
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1258
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1259
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1260
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1261
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1262
-	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1263
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1264
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1253
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1254
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1255
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1256
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1257
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1258
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1259
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1260
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1261
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1262
+	$globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);
1263
+	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE'));
1264
+	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE'));
1265 1265
 
1266 1266
 /*	
1267 1267
 	$globalSBS1Hosts = array();
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
 	}
1278 1278
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1279 1279
 */
1280
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1280
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1281 1281
 	$host = $_POST['host'];
1282 1282
 	$port = $_POST['port'];
1283 1283
 	$name = $_POST['name'];
@@ -1294,115 +1294,115 @@  discard block
 block discarded – undo
1294 1294
 		else $cov = 'FALSE';
1295 1295
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1296 1296
 		else $arch = 'FALSE';
1297
-		if (strpos($format[$key],'_callback')) {
1298
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1297
+		if (strpos($format[$key], '_callback')) {
1298
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1299 1299
 		} elseif ($h != '' || $name[$key] != '') {
1300
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1300
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1301 1301
 		}
1302 1302
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1303 1303
 	}
1304
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1304
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1305 1305
 
1306 1306
 /*
1307 1307
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1308 1308
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1309 1309
 */
1310
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1311
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1312
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1310
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1311
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1312
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1313 1313
 
1314
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1315
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1314
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1315
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1316 1316
 
1317
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1318
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1317
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1318
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1319 1319
 
1320
-	$map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);
1321
-	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile));
1320
+	$map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);
1321
+	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile));
1322 1322
 
1323
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1324
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1325
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1326
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1323
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1324
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1325
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1326
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1327 1327
 
1328
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1329
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1330
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1328
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1329
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1330
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1331 1331
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1332
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1333
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1332
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1333
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1334 1334
 
1335
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1336
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1337
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1338
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1339
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1340
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1341
-	$minfetch = filter_input(INPUT_POST,'minfetch',FILTER_SANITIZE_NUMBER_INT);
1342
-	$settings = array_merge($settings,array('globalMinFetch' => $minfetch));
1343
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1344
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1335
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1336
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1337
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1338
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1339
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1340
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1341
+	$minfetch = filter_input(INPUT_POST, 'minfetch', FILTER_SANITIZE_NUMBER_INT);
1342
+	$settings = array_merge($settings, array('globalMinFetch' => $minfetch));
1343
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1344
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1345 1345
 
1346
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1347
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1346
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1347
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1348 1348
 
1349
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1350
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1349
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1350
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1351 1351
 	
1352
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1352
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1353 1353
 	if ($archiveyear == "archiveyear") {
1354
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1354
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1355 1355
 	} else {
1356
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1356
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1357 1357
 	}
1358
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1359
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1360
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1361
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1358
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1359
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1360
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1361
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1362 1362
 
1363
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1364
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1365
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1366
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1363
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1364
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1365
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1366
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1367 1367
 
1368
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1369
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1370
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1368
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1369
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1370
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1371 1371
 
1372 1372
 	// Create in settings.php keys not yet configurable if not already here
1373 1373
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1374
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1374
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1375 1375
 
1376
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1376
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1377 1377
 	if ($resetyearstats == 'resetyearstats') {
1378
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1378
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1379 1379
 	} else {
1380
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1380
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1381 1381
 	}
1382 1382
 
1383
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1383
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1384 1384
 	if ($archive == 'archive') {
1385
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1385
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1386 1386
 	} else {
1387
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1387
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1388 1388
 	}
1389
-	$archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);
1389
+	$archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);
1390 1390
 	if ($archiveresults == 'archiveresults') {
1391
-		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE'));
1391
+		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE'));
1392 1392
 	} else {
1393
-		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE'));
1393
+		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE'));
1394 1394
 	}
1395
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1395
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1396 1396
 	if ($daemon == 'daemon') {
1397
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1397
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1398 1398
 	} else {
1399
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1399
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1400 1400
 	}
1401
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1401
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1402 1402
 	if ($schedules == 'schedules') {
1403
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1403
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1404 1404
 	} else {
1405
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1405
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1406 1406
 	}
1407 1407
 
1408 1408
 /*
@@ -1413,274 +1413,274 @@  discard block
 block discarded – undo
1413 1413
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1414 1414
 	}
1415 1415
 */
1416
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1417
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1418
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1419
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1420
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1416
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1417
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1418
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1419
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1420
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1421 1421
 	$va = false;
1422 1422
 	if ($globalivao == 'ivao') {
1423
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1423
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1424 1424
 		$va = true;
1425
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1425
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1426 1426
 	if ($globalvatsim == 'vatsim') {
1427
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1427
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1428 1428
 		$va = true;
1429
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1429
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1430 1430
 	if ($globalphpvms == 'phpvms') {
1431
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1431
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1432 1432
 		$va = true;
1433
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1433
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1434 1434
 	if ($globalvam == 'vam') {
1435
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1435
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1436 1436
 		$va = true;
1437
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1437
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1438 1438
 	if ($va) {
1439
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1440
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1439
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1440
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1441 1441
 	if ($globalva == 'va' || $va) {
1442
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1443
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1442
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1443
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1444 1444
 	} else {
1445
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1446
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1447
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1445
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1446
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1447
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1448 1448
 	}
1449 1449
 	
1450 1450
 	
1451
-	$mapoffline = filter_input(INPUT_POST,'mapoffline',FILTER_SANITIZE_STRING);
1451
+	$mapoffline = filter_input(INPUT_POST, 'mapoffline', FILTER_SANITIZE_STRING);
1452 1452
 	if ($mapoffline == 'mapoffline') {
1453
-		$settings = array_merge($settings,array('globalMapOffline' => 'TRUE'));
1453
+		$settings = array_merge($settings, array('globalMapOffline' => 'TRUE'));
1454 1454
 	} else {
1455
-		$settings = array_merge($settings,array('globalMapOffline' => 'FALSE'));
1455
+		$settings = array_merge($settings, array('globalMapOffline' => 'FALSE'));
1456 1456
 	}
1457
-	$globaloffline = filter_input(INPUT_POST,'globaloffline',FILTER_SANITIZE_STRING);
1457
+	$globaloffline = filter_input(INPUT_POST, 'globaloffline', FILTER_SANITIZE_STRING);
1458 1458
 	if ($globaloffline == 'globaloffline') {
1459
-		$settings = array_merge($settings,array('globalOffline' => 'TRUE'));
1459
+		$settings = array_merge($settings, array('globalOffline' => 'TRUE'));
1460 1460
 	} else {
1461
-		$settings = array_merge($settings,array('globalOffline' => 'FALSE'));
1461
+		$settings = array_merge($settings, array('globalOffline' => 'FALSE'));
1462 1462
 	}
1463 1463
 
1464
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1464
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1465 1465
 	if ($notam == 'notam') {
1466
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1466
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1467 1467
 	} else {
1468
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1468
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1469 1469
 	}
1470
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1470
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1471 1471
 	if ($owner == 'owner') {
1472
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1472
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1473 1473
 	} else {
1474
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1474
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1475 1475
 	}
1476
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1476
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1477 1477
 	if ($map3d == 'map3d') {
1478
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1478
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1479 1479
 	} else {
1480
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1480
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1481 1481
 	}
1482
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1482
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1483 1483
 	if ($crash == 'crash') {
1484
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1484
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1485 1485
 	} else {
1486
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1486
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1487 1487
 	}
1488
-	$fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);
1488
+	$fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);
1489 1489
 	if ($fires == 'fires') {
1490
-		$settings = array_merge($settings,array('globalMapFires' => 'TRUE'));
1490
+		$settings = array_merge($settings, array('globalMapFires' => 'TRUE'));
1491 1491
 	} else {
1492
-		$settings = array_merge($settings,array('globalMapFires' => 'FALSE'));
1492
+		$settings = array_merge($settings, array('globalMapFires' => 'FALSE'));
1493 1493
 	}
1494
-	$firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);
1494
+	$firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);
1495 1495
 	if ($firessupport == 'firessupport') {
1496
-		$settings = array_merge($settings,array('globalFires' => 'TRUE'));
1496
+		$settings = array_merge($settings, array('globalFires' => 'TRUE'));
1497 1497
 	} else {
1498
-		$settings = array_merge($settings,array('globalFires' => 'FALSE'));
1498
+		$settings = array_merge($settings, array('globalFires' => 'FALSE'));
1499 1499
 	}
1500
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1500
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1501 1501
 	if ($mapsatellites == 'mapsatellites') {
1502
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1502
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1503 1503
 	} else {
1504
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1504
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1505 1505
 	}
1506
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1506
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1507 1507
 	if ($map3ddefault == 'map3ddefault') {
1508
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1508
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1509 1509
 	} else {
1510
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1510
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1511 1511
 	}
1512
-	$map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);
1512
+	$map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);
1513 1513
 	if ($map3dliveries == 'map3dliveries') {
1514
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE'));
1514
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE'));
1515 1515
 	} else {
1516
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE'));
1516
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE'));
1517 1517
 	}
1518
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1518
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1519 1519
 	if ($translate == 'translate') {
1520
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1520
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1521 1521
 	} else {
1522
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1522
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1523 1523
 	}
1524
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1524
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1525 1525
 	if ($realairlines == 'realairlines') {
1526
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1526
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1527 1527
 	} else {
1528
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1528
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1529 1529
 	}
1530
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1530
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1531 1531
 	if ($estimation == 'estimation') {
1532
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1532
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1533 1533
 	} else {
1534
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1534
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1535 1535
 	}
1536
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1536
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1537 1537
 	if ($metar == 'metar') {
1538
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1538
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1539 1539
 	} else {
1540
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1540
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1541 1541
 	}
1542
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1542
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1543 1543
 	if ($metarcycle == 'metarcycle') {
1544
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1544
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1545 1545
 	} else {
1546
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1546
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1547 1547
 	}
1548
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1548
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1549 1549
 	if ($fork == 'fork') {
1550
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1550
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1551 1551
 	} else {
1552
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1552
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1553 1553
 	}
1554 1554
 
1555
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1555
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1556 1556
 	if ($colormap == 'colormap') {
1557
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1557
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1558 1558
 	} else {
1559
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1559
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1560 1560
 	}
1561 1561
 	
1562 1562
 	if (isset($_POST['aircrafticoncolor'])) {
1563
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1564
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1563
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1564
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1565 1565
 	}
1566 1566
 
1567
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1568
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1567
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1568
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1569 1569
 
1570
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1571
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1572
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1573
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1574
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1575
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1570
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1571
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1572
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1573
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1574
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1575
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1576 1576
 
1577
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1577
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1578 1578
 	if ($mappopup == 'mappopup') {
1579
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1579
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1580 1580
 	} else {
1581
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1581
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1582 1582
 	}
1583
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1583
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1584 1584
 	if ($airportpopup == 'airportpopup') {
1585
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1585
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1586 1586
 	} else {
1587
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1587
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1588 1588
 	}
1589
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1589
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1590 1590
 	if ($maphistory == 'maphistory') {
1591
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1591
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1592 1592
 	} else {
1593
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1593
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1594 1594
 	}
1595
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1595
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1596 1596
 	if ($maptooltip == 'maptooltip') {
1597
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1597
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1598 1598
 	} else {
1599
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1599
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1600 1600
 	}
1601
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1601
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1602 1602
 	if ($flightroute == 'flightroute') {
1603
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1603
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1604 1604
 	} else {
1605
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1605
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1606 1606
 	}
1607
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1607
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1608 1608
 	if ($flightremainingroute == 'flightremainingroute') {
1609
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1609
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1610 1610
 	} else {
1611
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1611
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1612 1612
 	}
1613
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1613
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1614 1614
 	if ($allflights == 'allflights') {
1615
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1615
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1616 1616
 	} else {
1617
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1617
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1618 1618
 	}
1619
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1619
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1620 1620
 	if ($bbox == 'bbox') {
1621
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1621
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1622 1622
 	} else {
1623
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1623
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1624 1624
 	}
1625
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1625
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1626 1626
 	if ($groundaltitude == 'groundaltitude') {
1627
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1627
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1628 1628
 	} else {
1629
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1629
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1630 1630
 	}
1631
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1631
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1632 1632
 	if ($waypoints == 'waypoints') {
1633
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1633
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1634 1634
 	} else {
1635
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1635
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1636 1636
 	}
1637
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1637
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1638 1638
 	if ($geoid == 'geoid') {
1639
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1639
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1640 1640
 	} else {
1641
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1641
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1642 1642
 	}
1643
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1644
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1643
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1644
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1645 1645
 
1646
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1646
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1647 1647
 	if ($noairlines == 'noairlines') {
1648
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1648
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1649 1649
 	} else {
1650
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1650
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1651 1651
 	}
1652 1652
 
1653
-	$tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);
1653
+	$tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);
1654 1654
 	if ($tsk == 'tsk') {
1655
-		$settings = array_merge($settings,array('globalTSK' => 'TRUE'));
1655
+		$settings = array_merge($settings, array('globalTSK' => 'TRUE'));
1656 1656
 	} else {
1657
-		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1657
+		$settings = array_merge($settings, array('globalTSK' => 'FALSE'));
1658 1658
 	}
1659
-	$mapmatching = filter_input(INPUT_POST,'mapmatching',FILTER_SANITIZE_STRING);
1659
+	$mapmatching = filter_input(INPUT_POST, 'mapmatching', FILTER_SANITIZE_STRING);
1660 1660
 	if ($mapmatching == 'mapmatching') {
1661
-		$settings = array_merge($settings,array('globalMapMatching' => 'TRUE'));
1661
+		$settings = array_merge($settings, array('globalMapMatching' => 'TRUE'));
1662 1662
 	} else {
1663
-		$settings = array_merge($settings,array('globalMapMatching' => 'FALSE'));
1663
+		$settings = array_merge($settings, array('globalMapMatching' => 'FALSE'));
1664 1664
 	}
1665
-	$mapmatchingsource = filter_input(INPUT_POST,'mapmatchingsource',FILTER_SANITIZE_STRING);
1666
-	$settings = array_merge($settings,array('globalMapMatchingSource' => $mapmatchingsource));
1667
-	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1668
-	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1665
+	$mapmatchingsource = filter_input(INPUT_POST, 'mapmatchingsource', FILTER_SANITIZE_STRING);
1666
+	$settings = array_merge($settings, array('globalMapMatchingSource' => $mapmatchingsource));
1667
+	$graphhopper = filter_input(INPUT_POST, 'graphhopper', FILTER_SANITIZE_STRING);
1668
+	$settings = array_merge($settings, array('globalGraphHopperKey' => $graphhopper));
1669 1669
 
1670
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1670
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1671 1671
 
1672 1672
 	// Set some defaults values...
1673 1673
 	if (!isset($globalAircraftImageSources)) {
1674
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1675
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1674
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1675
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1676 1676
 	}
1677 1677
 
1678 1678
 	if (!isset($globalSchedulesSources)) {
1679
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1680
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1679
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1680
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1681 1681
     	}
1682 1682
 
1683
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1683
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1684 1684
 
1685 1685
 	if ($error == '') settings::modify_settings($settings);
1686 1686
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +588 added lines, -158 removed lines patch added patch discarded remove patch
@@ -4,11 +4,19 @@  discard block
 block discarded – undo
4 4
 if (isset($_SESSION['error'])) {
5 5
 	header('Content-Encoding: none;');
6 6
 	echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.';
7
-	if (isset($_SESSION['error'])) unset($_SESSION['error']);
8
-	if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']);
9
-	if (isset($_SESSION['next'])) unset($_SESSION['next']);
10
-	if (isset($_SESSION['install'])) unset($_SESSION['install']);
11
-}
7
+	if (isset($_SESSION['error'])) {
8
+		unset($_SESSION['error']);
9
+	}
10
+	if (isset($_SESSION['errorlst'])) {
11
+		unset($_SESSION['errorlst']);
12
+	}
13
+	if (isset($_SESSION['next'])) {
14
+		unset($_SESSION['next']);
15
+	}
16
+	if (isset($_SESSION['install'])) {
17
+		unset($_SESSION['install']);
18
+	}
19
+	}
12 20
 /*
13 21
 if (isset($_SESSION['errorlst'])) {
14 22
 	header('Content-Encoding: none;');
@@ -159,45 +167,72 @@  discard block
 block discarded – undo
159 167
 			</div>
160 168
 			<p>
161 169
 				<label for="dbhost">Database hostname</label>
162
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
170
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
171
+	print $globalDBhost;
172
+}
173
+?>" />
163 174
 			</p>
164 175
 			<p>
165 176
 				<label for="dbport">Database port</label>
166
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
177
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
178
+	print $globalDBport;
179
+}
180
+?>" />
167 181
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
168 182
 			</p>
169 183
 			<p>
170 184
 				<label for="dbname">Database name</label>
171
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
185
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
186
+	print $globalDBname;
187
+}
188
+?>" />
172 189
 			</p>
173 190
 			<p>
174 191
 				<label for="dbuser">Database user</label>
175
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
192
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
193
+	print $globalDBuser;
194
+}
195
+?>" />
176 196
 			</p>
177 197
 			<p>
178 198
 				<label for="dbuserpass">Database user password</label>
179
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
199
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
200
+	print $globalDBpass;
201
+}
202
+?>" />
180 203
 			</p>
181 204
 		</fieldset>
182 205
 		<fieldset id="site">
183 206
 			<legend>Site configuration</legend>
184 207
 			<p>
185 208
 				<label for="sitename">Site name</label>
186
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
209
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
210
+	print $globalName;
211
+}
212
+?>" />
187 213
 			</p>
188 214
 			<p>
189 215
 				<label for="siteurl">Site directory</label>
190
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
216
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
217
+	print $globalURL;
218
+}
219
+?>" />
191 220
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
192 221
 			</p>
193 222
 			<p>
194 223
 				<label for="timezone">Timezone</label>
195
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
224
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
225
+	print $globalTimezone;
226
+}
227
+?>" />
196 228
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
197 229
 			</p>
198 230
 			<p>
199 231
 				<label for="language">Language</label>
200
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
232
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
233
+	print $globalLanguage;
234
+}
235
+?>" />
201 236
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
202 237
 			</p>
203 238
 		</fieldset>
@@ -217,11 +252,17 @@  discard block
 block discarded – undo
217 252
 			<div id="mapbox_data">
218 253
 				<p>
219 254
 					<label for="mapboxid">Mapbox id</label>
220
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
255
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
256
+	print $globalMapboxId;
257
+}
258
+?>" />
221 259
 				</p>
222 260
 				<p>
223 261
 					<label for="mapboxtoken">Mapbox token</label>
224
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
262
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
263
+	print $globalMapboxToken;
264
+}
265
+?>" />
225 266
 				</p>
226 267
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
227 268
 			</div>
@@ -229,7 +270,10 @@  discard block
 block discarded – undo
229 270
 			<div id="google_data">
230 271
 				<p>
231 272
 					<label for="googlekey">Google API key</label>
232
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
273
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
274
+	print $globalGoogleAPIKey;
275
+}
276
+?>" />
233 277
 					<p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p>
234 278
 				</p>
235 279
 			</div>
@@ -237,7 +281,10 @@  discard block
 block discarded – undo
237 281
 			<div id="bing_data">
238 282
 				<p>
239 283
 					<label for="bingkey">Bing Map key</label>
240
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
284
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
285
+	print $globalBingMapKey;
286
+}
287
+?>" />
241 288
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
242 289
 				</p>
243 290
 			</div>
@@ -245,7 +292,10 @@  discard block
 block discarded – undo
245 292
 			<div id="mapquest_data">
246 293
 				<p>
247 294
 					<label for="mapquestkey">MapQuest key</label>
248
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
295
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
296
+	print $globalMapQuestKey;
297
+}
298
+?>" />
249 299
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
250 300
 				</p>
251 301
 			</div>
@@ -253,11 +303,17 @@  discard block
 block discarded – undo
253 303
 			<div id="here_data">
254 304
 				<p>
255 305
 					<label for="hereappid">Here App_Id</label>
256
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
306
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
307
+	print $globalHereappId;
308
+}
309
+?>" />
257 310
 				</p>
258 311
 				<p>
259 312
 					<label for="hereappcode">Here App_Code</label>
260
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
313
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
314
+	print $globalHereappCode;
315
+}
316
+?>" />
261 317
 				</p>
262 318
 				<p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p>
263 319
 			</div>
@@ -265,7 +321,10 @@  discard block
 block discarded – undo
265 321
 			<div id="openweathermap_data">
266 322
 				<p>
267 323
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
268
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
324
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
325
+	print $globalOpenWeatherMapKey;
326
+}
327
+?>" />
269 328
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
270 329
 				</p>
271 330
 			</div>
@@ -294,42 +353,86 @@  discard block
 block discarded – undo
294 353
 			<legend>Coverage area</legend>
295 354
 			<p>
296 355
 				<label for="latitudemax">The maximum latitude (north)</label>
297
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
356
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
357
+	print $globalLatitudeMax;
358
+}
359
+?>" />
298 360
 			</p>
299 361
 			<p>
300 362
 				<label for="latitudemin">The minimum latitude (south)</label>
301
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
363
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
364
+	print $globalLatitudeMin;
365
+}
366
+?>" />
302 367
 			</p>
303 368
 			<p>
304 369
 				<label for="longitudemax">The maximum longitude (west)</label>
305
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
370
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
371
+	print $globalLongitudeMax;
372
+}
373
+?>" />
306 374
 			</p>
307 375
 			<p>
308 376
 				<label for="longitudemin">The minimum longitude (east)</label>
309
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
377
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
378
+	print $globalLongitudeMin;
379
+}
380
+?>" />
310 381
 			</p>
311 382
 			<p>
312 383
 				<label for="latitudecenter">The latitude center</label>
313
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
384
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
385
+	print $globalCenterLatitude;
386
+}
387
+?>" />
314 388
 			</p>
315 389
 			<p>
316 390
 				<label for="longitudecenter">The longitude center</label>
317
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
391
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
392
+	print $globalCenterLongitude;
393
+}
394
+?>" />
318 395
 			</p>
319 396
 			<p>
320 397
 				<label for="livezoom">Default Zoom on live map</label>
321
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
398
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
399
+	print $globalLiveZoom;
400
+} else {
401
+	print '9';
402
+}
403
+?>" />
322 404
 			</p>
323 405
 			<p>
324 406
 				<label for="squawk_country">Country for squawk usage</label>
325 407
 				<select name="squawk_country" id="squawk_country">
326
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
327
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
328
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
329
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
330
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
331
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
332
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
408
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
409
+	print ' selected ';
410
+}
411
+?>>UK</option>
412
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
413
+	print ' selected ';
414
+}
415
+?>>NZ</option>
416
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
417
+	print ' selected ';
418
+}
419
+?>>US</option>
420
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
421
+	print ' selected ';
422
+}
423
+?>>AU</option>
424
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
425
+	print ' selected ';
426
+}
427
+?>>NL</option>
428
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
429
+	print ' selected ';
430
+}
431
+?>>FR</option>
432
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
433
+	print ' selected ';
434
+}
435
+?>>TR</option>
333 436
 				</select>
334 437
 			</p>
335 438
 		</fieldset>
@@ -338,15 +441,24 @@  discard block
 block discarded – undo
338 441
 			<p><i>Only put in DB flights that are inside a circle</i></p>
339 442
 			<p>
340 443
 				<label for="latitude">Center latitude</label>
341
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
444
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
445
+	echo $globalDistanceIgnore['latitude'];
446
+}
447
+?>" />
342 448
 			</p>
343 449
 			<p>
344 450
 				<label for="longitude">Center longitude</label>
345
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
451
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
452
+	echo $globalDistanceIgnore['longitude'];
453
+}
454
+?>" />
346 455
 			</p>
347 456
 			<p>
348 457
 				<label for="Distance">Distance (in km)</label>
349
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
458
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
459
+	echo $globalDistanceIgnore['distance'];
460
+}
461
+?>" />
350 462
 			</p>
351 463
 		</fieldset>
352 464
 		<fieldset id="sourceloc">
@@ -462,11 +574,17 @@  discard block
 block discarded – undo
462 574
 			<div id="flightaware_data">
463 575
 				<p>
464 576
 					<label for="flightawareusername">FlightAware username</label>
465
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
577
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
578
+	print $globalFlightAwareUsername;
579
+}
580
+?>" />
466 581
 				</p>
467 582
 				<p>
468 583
 					<label for="flightawarepassword">FlightAware password/API key</label>
469
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
584
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
585
+	print $globalFlightAwarePassword;
586
+}
587
+?>" />
470 588
 				</p>
471 589
 			</div>
472 590
 -->
@@ -508,7 +626,10 @@  discard block
 block discarded – undo
508 626
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
509 627
 								?>
510 628
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
511
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
629
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
630
+	print $source['port'];
631
+}
632
+?>" /></td>
512 633
 								<?php
513 634
 								    } else {
514 635
 									$hostport = explode(':',$source['host']);
@@ -527,35 +648,110 @@  discard block
 block discarded – undo
527 648
 								?>
528 649
 								<td>
529 650
 									<select name="format[]" id="format">
530
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
531
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
532
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
533
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
534
-										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option>
535
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
536
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
537
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
538
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
539
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
540
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
541
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
542
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
543
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
544
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
545
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
546
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
547
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
548
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
549
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
550
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
551
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
651
+										<option value="auto" <?php if (!isset($source['format'])) {
652
+	print 'selected';
653
+}
654
+?>>Auto</option>
655
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
656
+	print 'selected';
657
+}
658
+?>>SBS</option>
659
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
660
+	print 'selected';
661
+}
662
+?>>TSV</option>
663
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
664
+	print 'selected';
665
+}
666
+?>>Raw</option>
667
+										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') {
668
+	print 'selected';
669
+}
670
+?>>Dump1090 aircraft.json</option>
671
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
672
+	print 'selected';
673
+}
674
+?>>APRS</option>
675
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
676
+	print 'selected';
677
+}
678
+?>>Radarcape deltadb.txt</option>
679
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
680
+	print 'selected';
681
+}
682
+?>>Vatsim</option>
683
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
684
+	print 'selected';
685
+}
686
+?>>Virtual Radar Server AircraftList.json</option>
687
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
688
+	print 'selected';
689
+}
690
+?>>Virtual Radar Server TCP</option>
691
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
692
+	print 'selected';
693
+}
694
+?>>phpVMS</option>
695
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
696
+	print 'selected';
697
+}
698
+?>>Virtual Airline Operations System (VAOS)</option>
699
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
700
+	print 'selected';
701
+}
702
+?>>Virtual Airlines Manager</option>
703
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
704
+	print 'selected';
705
+}
706
+?>>IVAO</option>
707
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
708
+	print 'selected';
709
+}
710
+?>>FlightGear Multiplayer</option>
711
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
712
+	print 'selected';
713
+}
714
+?>>FlightGear Singleplayer</option>
715
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
716
+	print 'selected';
717
+}
718
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
719
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
720
+	print 'selected';
721
+}
722
+?>>ACARS SBS-3 over TCP</option>
723
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
724
+	print 'selected';
725
+}
726
+?>>NMEA AIS over TCP</option>
727
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
728
+	print 'selected';
729
+}
730
+?>>AirWhere website</option>
731
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
732
+	print 'selected';
733
+}
734
+?>>HidnSeek Callback</option>
735
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
736
+	print 'selected';
737
+}
738
+?>>Blitzortung</option>
552 739
 									</select>
553 740
 								</td>
554 741
 								<td>
555
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
742
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
743
+	print $source['name'];
744
+}
745
+?>" />
556 746
 								</td>
557
-								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td>
558
-								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td>
747
+								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) {
748
+	print 'checked';
749
+}
750
+?> /></td>
751
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
752
+	print 'checked';
753
+}
754
+?> /></td>
559 755
 								<td>
560 756
 									<select name="timezones[]" id="timezones">
561 757
 								<?php
@@ -565,7 +761,9 @@  discard block
 block discarded – undo
565 761
 											print '<option selected>'.$timezones.'</option>';
566 762
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
567 763
 											print '<option selected>'.$timezones.'</option>';
568
-										} else print '<option>'.$timezones.'</option>';
764
+										} else {
765
+											print '<option>'.$timezones.'</option>';
766
+										}
569 767
 									}
570 768
 								?>
571 769
 									</select>
@@ -617,7 +815,9 @@  discard block
 block discarded – undo
617 815
 									foreach($timezonelist as $timezones){
618 816
 										if ($timezones == 'UTC') {
619 817
 											print '<option selected>'.$timezones.'</option>';
620
-										} else print '<option>'.$timezones.'</option>';
818
+										} else {
819
+											print '<option>'.$timezones.'</option>';
820
+										}
621 821
 									}
622 822
 								?>
623 823
 									</select>
@@ -642,11 +842,17 @@  discard block
 block discarded – undo
642 842
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
643 843
 					<p>
644 844
 						<label for="acarshost">ACARS UDP host</label>
645
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
845
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
846
+	print $globalACARSHost;
847
+}
848
+?>" />
646 849
 					</p>
647 850
 					<p>
648 851
 						<label for="acarsport">ACARS UDP port</label>
649
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
852
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
853
+	print $globalACARSPort;
854
+}
855
+?>" />
650 856
 					</p>
651 857
 				</fieldset>
652 858
 			</div>
@@ -672,17 +878,38 @@  discard block
 block discarded – undo
672 878
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
673 879
 				    <td>
674 880
 					<select name="newslang[]">
675
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
676
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
881
+					    <option value="en"<?php if ($lng == 'en') {
882
+	print ' selected';
883
+}
884
+?>>English</option>
885
+					    <option value="fr"<?php if ($lng == 'fr') {
886
+	print ' selected';
887
+}
888
+?>>French</option>
677 889
 					</select>
678 890
 				    </td>
679 891
 				    <td>
680 892
 					<select name="newstype[]">
681
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
682
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
683
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
684
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
685
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
893
+					    <option value="global"<?php if ($type == 'global') {
894
+	print ' selected';
895
+}
896
+?>>Global</option>
897
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
898
+	print ' selected';
899
+}
900
+?>>Aircraft</option>
901
+					    <option value="marine"<?php if ($type == 'marine') {
902
+	print ' selected';
903
+}
904
+?>>Marine</option>
905
+					    <option value="tracker"<?php if ($type == 'tracker') {
906
+	print ' selected';
907
+}
908
+?>>Tracker</option>
909
+					    <option value="satellite"<?php if ($type == 'Satellite') {
910
+	print ' selected';
911
+}
912
+?>>Satellite</option>
686 913
 					</select>
687 914
 				    </td>
688 915
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -815,13 +1042,19 @@  discard block
 block discarded – undo
815 1042
 			<div id="schedules_options">
816 1043
 				<p>
817 1044
 					<label for="britishairways">British Airways API Key</label>
818
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1045
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
1046
+	print $globalBritishAirwaysKey;
1047
+}
1048
+?>" />
819 1049
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
820 1050
 				</p>
821 1051
 				<!--
822 1052
 				<p>
823 1053
 					<label for="transavia">Transavia Test API Consumer Key</label>
824
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1054
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1055
+	print $globalTransaviaKey;
1056
+}
1057
+?>" />
825 1058
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
826 1059
 				</p>
827 1060
 				-->
@@ -830,10 +1063,16 @@  discard block
 block discarded – undo
830 1063
 						<b>Lufthansa API Key</b>
831 1064
 						<p>
832 1065
 							<label for="lufthansakey">Key</label>
833
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1066
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1067
+	print $globalLufthansaKey['key'];
1068
+}
1069
+?>" />
834 1070
 						</p><p>
835 1071
 							<label for="lufthansasecret">Secret</label>
836
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1072
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1073
+	print $globalLufthansaKey['secret'];
1074
+}
1075
+?>" />
837 1076
 						</p>
838 1077
 					</div>
839 1078
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -843,11 +1082,17 @@  discard block
 block discarded – undo
843 1082
 						<b>FlightAware API Key</b>
844 1083
 						<p>
845 1084
 							<label for="flightawareusername">Username</label>
846
-							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
1085
+							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
1086
+	print $globalFlightAwareUsername;
1087
+}
1088
+?>" />
847 1089
 						</p>
848 1090
 						<p>
849 1091
 							<label for="flightawarepassword">API key</label>
850
-							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
1092
+							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
1093
+	print $globalFlightAwarePassword;
1094
+}
1095
+?>" />
851 1096
 						</p>
852 1097
 					</div>
853 1098
 					<p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p>
@@ -864,16 +1109,28 @@  discard block
 block discarded – undo
864 1109
 				<p>
865 1110
 					<label for="mapmatchingsource">Map Matching source</label>
866 1111
 					<select name="mapmatchingsource" id="mapmatchingsource">
867
-						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option>
868
-						<option value="osmr" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>OSMR</option>
869
-						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option>
1112
+						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') {
1113
+	print 'selected="selected" ';
1114
+}
1115
+?>>GraphHopper</option>
1116
+						<option value="osmr" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') || !isset($globalMatchingSource)) {
1117
+	print 'selected="selected" ';
1118
+}
1119
+?>>OSMR</option>
1120
+						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') {
1121
+	print 'selected="selected" ';
1122
+}
1123
+?>>Mapbox</option>
870 1124
 					</select>
871 1125
 					<p class="help-block">Mapbox need the API Key defined in map section</p>
872 1126
 				</p>
873 1127
 				<br />
874 1128
 				<p>
875 1129
 					<label for="graphhopper">GraphHopper API Key</label>
876
-					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" />
1130
+					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) {
1131
+	print $globalGraphHopperKey;
1132
+}
1133
+?>" />
877 1134
 					<p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p>
878 1135
 				</p>
879 1136
 			</div>
@@ -891,7 +1148,10 @@  discard block
 block discarded – undo
891 1148
 			</p>
892 1149
 			<p>
893 1150
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
894
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1151
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1152
+	print $globalNOTAMSource;
1153
+}
1154
+?>" />
895 1155
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
896 1156
 			</p>
897 1157
 			<br />
@@ -907,14 +1167,20 @@  discard block
 block discarded – undo
907 1167
 			<div id="metarsrc">
908 1168
 				<p>
909 1169
 					<label for="metarsource">URL of your METAR source</label>
910
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1170
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1171
+	print $globalMETARurl;
1172
+}
1173
+?>" />
911 1174
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
912 1175
 				</p>
913 1176
 			</div>
914 1177
 			<br />
915 1178
 			<p>
916 1179
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
917
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1180
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1181
+	print $globalBitlyAccessToken;
1182
+}
1183
+?>" />
918 1184
 			</p>
919 1185
 			<br />
920 1186
 			<p>
@@ -930,11 +1196,26 @@  discard block
 block discarded – undo
930 1196
 			<p>
931 1197
 				<label for="geoid_source">Geoid Source</label>
932 1198
 				<select name="geoid_source" id="geoid_source">
933
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
934
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
935
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
936
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
937
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1199
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1200
+	print ' selected="selected"';
1201
+}
1202
+?>>EGM96 15' (2.1MB)</option>
1203
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1204
+	print ' selected="selected"';
1205
+}
1206
+?>>EGM96 5' (19MB)</option>
1207
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1208
+	print ' selected="selected"';
1209
+}
1210
+?>>EGM2008 5' (19MB)</option>
1211
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1212
+	print ' selected="selected"';
1213
+}
1214
+?>>EGM2008 2.5' (75MB)</option>
1215
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1216
+	print ' selected="selected"';
1217
+}
1218
+?>>EGM2008 1' (470MB)</option>
938 1219
 				</select>
939 1220
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
940 1221
 			</p>
@@ -956,7 +1237,12 @@  discard block
 block discarded – undo
956 1237
 			</p>
957 1238
 			<p>
958 1239
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
959
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1240
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1241
+	print $globalArchiveMonths;
1242
+} else {
1243
+	echo '1';
1244
+}
1245
+?>" />
960 1246
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
961 1247
 			</p>
962 1248
 			<p>
@@ -966,12 +1252,22 @@  discard block
 block discarded – undo
966 1252
 			</p>
967 1253
 			<p>
968 1254
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
969
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1255
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1256
+	print $globalArchiveKeepMonths;
1257
+} else {
1258
+	echo '1';
1259
+}
1260
+?>" />
970 1261
 				<p class="help-block">0 to disable</p>
971 1262
 			</p>
972 1263
 			<p>
973 1264
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
974
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1265
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1266
+	print $globalArchiveKeepTrackMonths;
1267
+} else {
1268
+	echo '1';
1269
+}
1270
+?>" />
975 1271
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
976 1272
 			</p>
977 1273
 			<br />
@@ -981,7 +1277,12 @@  discard block
 block discarded – undo
981 1277
 				<p class="help-block">Uncheck if the script is running as cron job. You should always run it as daemon when it's possible.</p>
982 1278
 				<div id="cronends"> 
983 1279
 					<label for="cronend">Run script for xx seconds</label>
984
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1280
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1281
+	print $globalCronEnd;
1282
+} else {
1283
+	print '0';
1284
+}
1285
+?>" />
985 1286
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
986 1287
 				</div>
987 1288
 			</p>
@@ -1034,20 +1335,40 @@  discard block
 block discarded – undo
1034 1335
 			<br />
1035 1336
 			<p>
1036 1337
 				<label for="refresh">Show flights detected since xxx seconds</label>
1037
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1338
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1339
+	echo $globalLiveInterval;
1340
+} else {
1341
+	echo '200';
1342
+}
1343
+?>" />
1038 1344
 			</p>
1039 1345
 			<p>
1040 1346
 				<label for="maprefresh">Live map refresh (in seconds)</label>
1041
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1347
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1348
+	echo $globalMapRefresh;
1349
+} else {
1350
+	echo '30';
1351
+}
1352
+?>" />
1042 1353
 			</p>
1043 1354
 			<p>
1044 1355
 				<label for="mapidle">Map idle timeout (in minutes)</label>
1045
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1356
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1357
+	echo $globalMapIdleTimeout;
1358
+} else {
1359
+	echo '30';
1360
+}
1361
+?>" />
1046 1362
 				<p class="help-block">0 to disable</p>
1047 1363
 			</p>
1048 1364
 			<p>
1049 1365
 				<label for="minfetch">HTTP/file source fetch every xxx seconds</label>
1050
-				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" />
1366
+				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) {
1367
+	echo $globalMinFetch;
1368
+} else {
1369
+	echo '20';
1370
+}
1371
+?>" />
1051 1372
 			</p>
1052 1373
 			<p>
1053 1374
 				<label for="bbox">Only display flights that we can see on screen (bounding box)</label>
@@ -1061,12 +1382,20 @@  discard block
 block discarded – undo
1061 1382
 			<br />
1062 1383
 			<p>
1063 1384
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
1064
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1385
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1386
+	echo $globalClosestMinDist;
1387
+} else {
1388
+	echo '50';
1389
+}
1390
+?>" />
1065 1391
 			</p>
1066 1392
 			<br />
1067 1393
 			<p>
1068 1394
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1069
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1395
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1396
+	echo $globalAircraftSize;
1397
+}
1398
+?>" />
1070 1399
 			</p>
1071 1400
 			<br />
1072 1401
 			<p>
@@ -1085,7 +1414,12 @@  discard block
 block discarded – undo
1085 1414
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
1086 1415
 			?>
1087 1416
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1088
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1417
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1418
+	echo $globalAircraftIconColor;
1419
+} else {
1420
+	echo '1a3151';
1421
+}
1422
+?>" />
1089 1423
 			<?php
1090 1424
 				if (!is_writable('../cache')) {
1091 1425
 			?>
@@ -1103,14 +1437,27 @@  discard block
 block discarded – undo
1103 1437
 			<p>
1104 1438
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1105 1439
 				<div class="range">
1106
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1107
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1440
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1441
+	echo $globalAirportZoom;
1442
+} else {
1443
+	echo '7';
1444
+}
1445
+?>" />
1446
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1447
+	echo $globalAirportZoom;
1448
+} else {
1449
+	echo '7';
1450
+}
1451
+?></output>
1108 1452
 				</div>
1109 1453
 			</p>
1110 1454
 			<br />
1111 1455
 			<p>
1112 1456
 				<label for="customcss">Custom CSS web path</label>
1113
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1457
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1458
+	echo $globalCustomCSS;
1459
+}
1460
+?>" />
1114 1461
 			</p>
1115 1462
 		</fieldset>
1116 1463
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1137,8 +1484,12 @@  discard block
 block discarded – undo
1137 1484
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1138 1485
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1139 1486
 
1140
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1141
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1487
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1488
+		$error .= 'Mysql driver for PDO must be loaded';
1489
+	}
1490
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1491
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1492
+	}
1142 1493
 	
1143 1494
 	$_SESSION['database_root'] = $dbroot;
1144 1495
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1206,15 +1557,23 @@  discard block
 block discarded – undo
1206 1557
 	$source_city = $_POST['source_city'];
1207 1558
 	$source_country = $_POST['source_country'];
1208 1559
 	$source_ref = $_POST['source_ref'];
1209
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1210
-	else $source_id = array();
1560
+	if (isset($source_id)) {
1561
+		$source_id = $_POST['source_id'];
1562
+	} else {
1563
+		$source_id = array();
1564
+	}
1211 1565
 	
1212 1566
 	$sources = array();
1213 1567
 	foreach ($source_name as $keys => $name) {
1214
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1215
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1568
+	    if (isset($source_id[$keys])) {
1569
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1570
+	    } else {
1571
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1572
+	    }
1573
+	}
1574
+	if (count($sources) > 0) {
1575
+		$_SESSION['sources'] = $sources;
1216 1576
 	}
1217
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1218 1577
 
1219 1578
 	$newsurl = $_POST['newsurl'];
1220 1579
 	$newslng = $_POST['newslang'];
@@ -1227,7 +1586,9 @@  discard block
 block discarded – undo
1227 1586
 		$lng = $newslng[$newskey];
1228 1587
 		if (isset($newsfeeds[$type][$lng])) {
1229 1588
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1230
-		} else $newsfeeds[$type][$lng] = array($url);
1589
+		} else {
1590
+			$newsfeeds[$type][$lng] = array($url);
1591
+		}
1231 1592
 	    }
1232 1593
 	}
1233 1594
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1251,17 +1612,29 @@  discard block
 block discarded – undo
1251 1612
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1252 1613
 
1253 1614
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1254
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1255
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1615
+	if ($globalaircraft == 'aircraft') {
1616
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1617
+	} else {
1618
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1619
+	}
1256 1620
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1257
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1258
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1621
+	if ($globaltracker == 'tracker') {
1622
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1623
+	} else {
1624
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1625
+	}
1259 1626
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1260
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1261
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1627
+	if ($globalmarine == 'marine') {
1628
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1629
+	} else {
1630
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1631
+	}
1262 1632
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1263
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1264
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1633
+	if ($globalsatellite == 'satellite') {
1634
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1635
+	} else {
1636
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1637
+	}
1265 1638
 
1266 1639
 /*	
1267 1640
 	$globalSBS1Hosts = array();
@@ -1283,23 +1656,37 @@  discard block
 block discarded – undo
1283 1656
 	$name = $_POST['name'];
1284 1657
 	$format = $_POST['format'];
1285 1658
 	$timezones = $_POST['timezones'];
1286
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1287
-	else $sourcestats = array();
1288
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1289
-	else $noarchive = array();
1659
+	if (isset($_POST['sourcestats'])) {
1660
+		$sourcestats = $_POST['sourcestats'];
1661
+	} else {
1662
+		$sourcestats = array();
1663
+	}
1664
+	if (isset($_POST['noarchive'])) {
1665
+		$noarchive = $_POST['noarchive'];
1666
+	} else {
1667
+		$noarchive = array();
1668
+	}
1290 1669
 	$gSources = array();
1291 1670
 	$forcepilots = false;
1292 1671
 	foreach ($host as $key => $h) {
1293
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1294
-		else $cov = 'FALSE';
1295
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1296
-		else $arch = 'FALSE';
1672
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1673
+			$cov = 'TRUE';
1674
+		} else {
1675
+			$cov = 'FALSE';
1676
+		}
1677
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1678
+			$arch = 'TRUE';
1679
+		} else {
1680
+			$arch = 'FALSE';
1681
+		}
1297 1682
 		if (strpos($format[$key],'_callback')) {
1298 1683
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1299 1684
 		} elseif ($h != '' || $name[$key] != '') {
1300 1685
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1301 1686
 		}
1302
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1687
+		if ($format[$key] == 'airwhere') {
1688
+			$forcepilots = true;
1689
+		}
1303 1690
 	}
1304 1691
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1305 1692
 
@@ -1330,7 +1717,9 @@  discard block
 block discarded – undo
1330 1717
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1331 1718
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1332 1719
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1333
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1720
+	} else {
1721
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1722
+	}
1334 1723
 
1335 1724
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1336 1725
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1371,7 +1760,9 @@  discard block
 block discarded – undo
1371 1760
 
1372 1761
 	// Create in settings.php keys not yet configurable if not already here
1373 1762
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1374
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1763
+	if (!isset($globalDebug)) {
1764
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1765
+	}
1375 1766
 
1376 1767
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1377 1768
 	if ($resetyearstats == 'resetyearstats') {
@@ -1414,37 +1805,56 @@  discard block
 block discarded – undo
1414 1805
 	}
1415 1806
 */
1416 1807
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1417
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1418
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1419
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1420
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1808
+	if ($globalsbs == 'sbs') {
1809
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1810
+	} else {
1811
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1812
+	}
1813
+	if ($globalaprs == 'aprs') {
1814
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1815
+	} else {
1816
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1817
+	}
1421 1818
 	$va = false;
1422 1819
 	if ($globalivao == 'ivao') {
1423 1820
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1424 1821
 		$va = true;
1425
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1822
+	} else {
1823
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1824
+	}
1426 1825
 	if ($globalvatsim == 'vatsim') {
1427 1826
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1428 1827
 		$va = true;
1429
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1828
+	} else {
1829
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1830
+	}
1430 1831
 	if ($globalphpvms == 'phpvms') {
1431 1832
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1432 1833
 		$va = true;
1433
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1834
+	} else {
1835
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1836
+	}
1434 1837
 	if ($globalvam == 'vam') {
1435 1838
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1436 1839
 		$va = true;
1437
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1840
+	} else {
1841
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1842
+	}
1438 1843
 	if ($va) {
1439 1844
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1440
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1845
+	} else {
1846
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1847
+	}
1441 1848
 	if ($globalva == 'va' || $va) {
1442 1849
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1443 1850
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1444 1851
 	} else {
1445 1852
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1446
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1447
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1853
+		if ($forcepilots) {
1854
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1855
+		} else {
1856
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1857
+		}
1448 1858
 	}
1449 1859
 	
1450 1860
 	
@@ -1667,7 +2077,9 @@  discard block
 block discarded – undo
1667 2077
 	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1668 2078
 	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1669 2079
 
1670
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2080
+	if (!isset($globalTransaction)) {
2081
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2082
+	}
1671 2083
 
1672 2084
 	// Set some defaults values...
1673 2085
 	if (!isset($globalAircraftImageSources)) {
@@ -1682,15 +2094,23 @@  discard block
 block discarded – undo
1682 2094
 
1683 2095
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1684 2096
 
1685
-	if ($error == '') settings::modify_settings($settings);
1686
-	if ($error == '') settings::comment_settings($settings_comment);
2097
+	if ($error == '') {
2098
+		settings::modify_settings($settings);
2099
+	}
2100
+	if ($error == '') {
2101
+		settings::comment_settings($settings_comment);
2102
+	}
1687 2103
 	if ($error != '') {
1688 2104
 		print '<div class="info column">'.$error.'</div>';
1689 2105
 		require('../footer.php');
1690 2106
 		exit;
1691 2107
 	} else {
1692
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1693
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
2108
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
2109
+			$_SESSION['waypoints'] = 1;
2110
+		}
2111
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
2112
+			$_SESSION['owner'] = 1;
2113
+		}
1694 2114
 		if (isset($_POST['createdb'])) {
1695 2115
 			$_SESSION['install'] = 'database_create';
1696 2116
 		} else {
@@ -1727,10 +2147,18 @@  discard block
 block discarded – undo
1727 2147
 	$popw = false;
1728 2148
 	foreach ($_SESSION['done'] as $done) {
1729 2149
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1730
-	    if ($done == 'Create database') $pop = true;
1731
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1732
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1733
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2150
+	    if ($done == 'Create database') {
2151
+	    	$pop = true;
2152
+	    }
2153
+	    if ($_SESSION['install'] == 'database_create') {
2154
+	    	$pop = true;
2155
+	    }
2156
+	    if ($_SESSION['install'] == 'database_import') {
2157
+	    	$popi = true;
2158
+	    }
2159
+	    if ($_SESSION['install'] == 'waypoints') {
2160
+	    	$popw = true;
2161
+	    }
1734 2162
 	}
1735 2163
 	if ($pop) {
1736 2164
 	    sleep(5);
@@ -1741,7 +2169,9 @@  discard block
 block discarded – undo
1741 2169
 	} else if ($popw) {
1742 2170
 	    sleep(5);
1743 2171
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1744
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2172
+	} else {
2173
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2174
+	}
1745 2175
 	print '</div></ul>';
1746 2176
 	print '<div id="error"></div>';
1747 2177
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.